-
Thread
Umwandlung Verilog / VHDL, kann man das einfacher machen?
reset : in std_logic := '0'; ReadReg1 : in std_logic_vector(4 downto 0) := (others => '0'); ReadReg2 : in std_logic_vector(4 downto 0) := (others => '0'); WriteReg : in std_logic_vector(4 downto 0) := (others => '0'); WriteData : in std_logic_vector(31 downto
type reg_t is array (0 to 31) of std_logic_vector(31 downto 0); signal registers : reg_t := (others => (others => '0')); begin -- Sequential (clocked) write. -- 'WriteReg' is the register index to write. 'RegWrite' is the command. process (clock) begin if (rising_edge
-
Thread
RAM: warum nicht synthetisierbar?
#6280347: > Die Tristate Geschichte musst du ausserhalb des Prozesses machen. [vhdl]data_q <= data when ce = '1' and rd = '0' and wr = '1' else (others => 'Z');[/vhdl] Da meckert mir das Radiant: [pre] (VHDL-1576) this construct is only supported in VHDL 1076-2008 [/pre] Habe ich nicht ganz
deine Arrays kannst du auch mit der folgenden Zeile Code initialisieren: signal cells: ram_t := (others => ( others => '0') );
-
Thread
Multiplikation mit DSP Block auf Cyclone V
EN2:=EN1; when 3=> IF(Rv<255)THEN R<=STD_LOGIC_VECTOR(to_unsigned(Rv,8)); ELSE R<=(others=>'1'); END IF; DATAVALID<=EN2; when others=> NULL; end case; end loop; [/vhdl] Wie man sieht, ich habe eine Art Pipeline Konstruktion. Das Problem ist jetzt folgendes: manchmal sind die RGB Daten noch nicht bereit, obwohl
-
Thread
SRAM wird nicht gelesen vom DE1
if counter(4) = '0' then sram_io <= "0000000000000111"; else sram_io <= (others => 'Z'); end if; end if; end process; sram_o <= sram_io; end Behavioral; [/vhdl] Danke. Gruss
musst also zwischen lesen und schreiben unterscheiden. Ganz grob: [vhdl] sram_io <= daten_out when lesenschreiben = '0' else (others => 'Z'); daten_in <= sram_io when lesenschreiben = '1'; [/vhdl] daten_out sind std_logic_vector und zwar die Daten die geschrieben werden sollen, daten_in ist
-
Thread
Multiplexer - Problem
Passend zu deinem ersten Ansatz: [vhdl] data3 <= data1 when sel = '0' else (others=>'Z'); data2 <= data3 when sel = '1' else (others=>'X'); [/vhdl] Bei data2 wird ein Latch verhindert und in der Simulation sollte es auffallen wenn der Pfad im deselektierten
one_to_two_mux_inout_input is signal data2_i : std_logic_vector(7 downto 0) := "00000000"; begin data3 <= data1 when sel = '0' else "ZZZZZZZZ"; data2 <= data3 when sel = '1' else "ZZZZZZZZ"; end Behavioral; [/vhdl] und synthese funzt super
-
Thread
Frequenzteiler
clock='1' ; count := count+1 ; CASE count IS WHEN 0 => t_clk <= NOT t_clk ; WHEN 2604/2 => t_clk <= NOT t_clk ; WHEN 2604 => count := 0; WHEN OTHERS => NULL ;
clock='1' ; count := count+1 ; CASE count IS WHEN 0 => t_clk <= NOT t_clk ; WHEN 500000/2 => t_clk <= NOT t_clk ; WHEN 500000 => count := 0; WHEN OTHERS => NULL ;
-
Thread
Probleme beim Verbinden der Signale zwischen zwei Modulen
z1:zaehler port map(clk, rst, enable, s); p2:process(s) begin case s is when "0000" => display <= "1111110"; when "0001" => display <= "0110000"; when "0010" => display <= "1101101"; when
when others => display <= "0000001"; end case; end process p2; end bevofsegment; -------------------------------------------------------------------------- ----
-
Thread
Binär Dividierer: Restoring Methode
y; two_r <= r&'0'; dif <= two_r - long_y; WITH dif(n) SELECT next_r <= dif(n-1 DOWNTO 0) WHEN '0', two_r(n-1 DOWNTO 0) WHEN OTHERS; remainder_register: PROCESS(clk) BEGIN IF clk'EVENT AND clk = '1' THEN IF load = '1' THEN r <= x; ELSIF update = '1' THEN r <= next_r
current_state <= 0; ELSIF clk'EVENT AND clk = '1' THEN CASE current_state IS WHEN 0 => IF start = '0' THEN current_state <= 1; END IF; WHEN 1 => IF start = '1' THEN current_state <= 2; END IF; WHEN 2 => current_state <= 3; WHEN 3 => IF count = p-1 THEN
-
Thread
64-Bit breites Datenwort via NIOS II auf Avalon schreiben?
data_buffer_nxt <= data_buffer; data_valid_nxt <= data_valid; state_nxt <= state; case state is when INIT => avs_s0_waitrequest <= '0'; state_nxt <= IDLE; when IDLE => if (avs_s0_write = '1') then if (avs_s0_address = 0x"01000000") then avs_s0_waitrequest <= '1'; state_nxt <= READ; end if; end if; when READ => avs_s0_waitrequest <= '1'; data_buffer_nxt <= avs_s0_writedata; state_nxt <= READ_WAIT; when READ_WAIT => avs_s0_waitrequest <= '0'; state_nxt <= IDLE
-
Thread
Befehl für keine Signalzuweisung
zu. In den anderen Cases wird diese Variable nicht verändert. case state is when a => variable_a <= "0001"; when b => variable_a <= variable_a; when others => variable_a <= variable_a; end case; Also ich suche nach etwas wie : variable_a <= null; Also was vom
Formale richtig wäre z.B.: [vhdl] case state is when a => variable_a <= "0001"; when b => null; when others => null; end case; [/vhdl] Das "null" braucht man, damit irgendetwas in der Zeile steht.
-
Thread
CPLD - I/O Erweiterung
); elsif (A(5 downto 3)="010") then addr_mux2 <= D(2 downto 0); end process; D <= (others => 'Z') when OE='1' else -- hochohmig, wenn nicht gelesen werden soll PA when (A="000000") else PB when (A="000001") else PC when (A="000010") else PD when (A="000011") else (others => '0'); : [/vhdl] EDIT: Stephan M. schrieb im Beitrag #2122085: > Dadurch kann ich beginnen das Layout zu planen > und die Programmierung später angehen. Leg das WR-Signal auf einen Takteingang
-
Thread
Einfacher Bus Multiplexer
i in 0 to (g_memory_map'length - 1) generate ... x_wb_master_o.dat <= x_wb_slave_array_i(i).dat when s_cs_vector(i) = '1' else (others => 'Z'); ... end generate; [/vhdl] Funktioniert in der Simu super, aber ich mag kein 'Z' für Sachen, die im FPGA laufen. Alternativ habe ich mir das überlegt:
... x_wb_master(i) <= x_wb_slave_array_i(i).dat when s_cs_vector(i) = '1' else (others => '0'); ... end generate; x_wb_master_o.dat <= x_wb_master(0) or x_wb_master(1) or .. [/vhdl] Hat natürlich das gleiche fiese Verhalten wie der Z-Bus. Wenn
-
Thread
Probleme mit Signalgenerator
clk : in std_logic; -- Systemclock (50 MHz) microsteps : in unsigned(31 downto 0) := (others => '0'); -- Anzahl der Schritte, in die die Wellenform unterteilt wird cnt_check : in unsigned(31 downto 0) := (others => '0'); run : in unsigned(31 downto 0) := (others =>
unsigned(31 downto 0) := (others => '0'); -- Regelung: 0 = nein, 1 = ja rechteck : out std_logic_vector(15 downto 0) := (others => '0'); saegezahn : out std_logic_vector(15 downto 0) := (others => '0');
-
Thread
Fehler in der Übertragung
process begin wait until falling_edge(main_clk); case FSM1 is when idle => if (dummy=15) then FSM1 <= Data0; intdb0 <= intdb0 + '1'; end if; wrreq <= '0'; when Data0 => FSM1 <= Data1; intdb0 <= intdb0 + '1'; DCFIFO <= intdb0; wrreq <= '1'; when Data1 => FSM1 <= idle; DCFIFO <= intdb0; wrreq <= '1'; when others => null; end case; end process; [/vhdl] Bzgl deiner vermutung hatte ich auch schon die
-
Thread
Bedingte Zuweisung in Port Map
der Port Map hinkriegen. Probiert habe ich sowas wie [vhdl]A: Addierer port map(AV(i),BV(i),'0' when i=0 else CV(i),ErgebnisV(i),CV(i+1));[/vhdl] in verschiedenen Varianten. Das scheint nicht zu funktionieren. Beim when wird immer ein Fehler angezeigt. [Natürlich geht es über loop 1 to Breite-1
> [vhdl]A: Addierer port map(AV(i),BV(i),'0' when i=0 else > CV(i),ErgebnisV(i),CV(i+1));[/vhdl] verständlichere Signalnamen als AV, BV und CV sind sinnvoller als jede elegant anmutende Syntaxverrenkung. SCNR,
-
Thread
Toggle FF
FF_INPUT: std_logic; begin KOMB: process(DATA_IN, NRZI_INT) begin case DATA_IN is when '1' => FF_INPUT <= NRZI_INT; when others => FF_INPUT <= DATA_IN xnor NRZI_INT; end case; end process KOMB; DFF: process (CLK, DATA_IN) begin if CLK'event and CLK = '1' then NRZI_INT
Mir kommt diese Zeile sehr komisch vor: when others => FF_INPUT <= DATA_IN xnor NRZI_INT; probier lieber mal: when others => FF_INPUT <= not NRZI_INT; Viele Grüße TobiFlex
-
Thread
Tasteneingabe mittels Erweiterungsboard?!
state, toest, seg3, seg2, seg1, seg0) begin -- process Multiplexer case state is when "100" => iobus_b <= leds; when "010" => iobus_b <= seg3; when "110" => iobus_b <= seg2; when "001" => iobus_b <= seg1; when "101" => iobus_b <= seg0; when others => iobus_b <= (others => 'Z'); end case; end process Multiplexer; -- purpose: FlipFlop for the buttons -- type : sequential -- inputs : precount, reset_n -- outputs: buttons buttons_FF: process
-
Thread
SRAM - wieso bekomm ich warnungen ?
sram 1 oder sram 2 sram_1_io <= write_dat_1; -- Daten schreiben sram_2_io <= (others => 'Z'); else sram_1_ce <= '1'; -- Sram 2 sram_2_ce <= '0'; sram_1_io <= (others => 'Z');-- Daten schreiben sram_2_io <= write_dat_1; end
sram_2_ce <= '0'; end if; end if; end process; sram_1_io <= write_dat_1 when (write_sel_1='0' and write_wrt_1='1') else (others => 'Z'); sram_1_io <= write_dat_1 when (write_sel_1='1' and write_wrt_1='1') else (others => 'Z'); [/vhdl] BTW: >-- IO auf Treestate
-
Thread
LSC Smart Connect - neues Smart Home System bei Action
GPIO0, GPIO2 and GPIO15. I didn’t add any resistors but I had to pull GPIO15 low (as I did before when flashing. Best Jan
wires them self's are rated for 300V as written in the wire itself. But they do touch each other when leaving the white box.
-
Thread
Merkwürdiges Verhalten mit diesem VHDL-Programm.
terminal_count <= '1'; count <= (others => '0'); else terminal_count <= '0'; end if; end process; process begin wait until rising_edge(clk); if terminal_count = '1' then case state is when "01" => state <= "10"; when "10" => state <= "01"; when others => state <= "01"; end case
-
Thread
String in std_logic_vector umwandeln
[vhdl] signal test_byte : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); : test_byte <= constant_bytes'pos(x"A9"); [/vhdl] Das geht sowieso nicht, weil 'pos einen Integer zurückliefert. Und zudem ist 'pos nicht auf solche zusammengesetzten Arrays anwendbar
Auswahlelement verwenden: [vhdl] if oneofmyfamily=mum then ... case oneofmyfamily is when mum => ... when dad => ... when others => ... end case; [/vhdl] > Das sieht fast so aus wie wenn man ein Enum deklariert: Das ist es eigentlich auch, allerdings sind hier bei VHDL
-
Thread
warning beim Implementieren einer State Machine
folgezustand <= a_SENDWERT_Z2; -- im Zustand z2 bleiben end if; when others => folgezustand <= zustand; -- zustand nicht verändern end case; end process ue_sn; TxData <= counter; TxPulse <= txflag; end Behavioral
clk) then zustand <= folgezustand; case folgezustand is -- BITTE BEACHTEN when a_SENDWERT_Z1 => counter <= counter +1 ; txflag <= '0'; when a_SENDWERT_Z2 => txflag <='1'; when others => null end
-
Thread
VHDL ERROR 10028
then var_e <= (var_e +1); end if; state <= ST_B; when others => null; end case; end if; end process H_Counter; V_Counter: process(RESET_n,CLK) -- ______________________ ________ -- ________| VIDEO
var_s <= (var_s +1); end if; state <= ST_P; when others => null; end case; end if; end process V_Counter; end rtl; [/vhdl] Ich bekomme folgenden Fehler: VHDL Error (10028): Can't resolve multiple constant drivers for net "state.ST_B
-
Thread
Frage zu fifo
Pointer. Der läuft kostenlos über: [vhdl] signal wrcnt : unsigned (Addrbreite-1 downto 0) := (others => '0'); signal rdcnt : unsigned (Addrbreite-1 downto 0) := (others => '0'); type speicher is array(0 to (2**Addrbreite)-1) of unsigned(Wortbreite-1 downto 0); signal memory : speicher;
; -- Adresse getaktet --> BRAM rdcnt <= rdcnt+1; end if; end process; Full <= '1' when rdcnt = wrcnt+1 else '0'; Empty <= '1' when rdcnt = wrcnt else '0'; end Behavioral; [/vhdl]
-
Thread
Sinus über DDS erzeugen
signal Result : std_logic_vector (7 downto 0); signal Accum : unsigned (20 downto 0) := (others=>'0'); alias Address : unsigned (5 downto 0) is Accum(Accum'high-2 downto Accum'high-7); alias Sign : std_logic is Accum(Accum'high); -- MSB alias Quadrant : std_logic is Accum(
Inputs signal clk : std_logic := '0'; signal Freq_Data : std_logic_vector(7 downto 0) := (others => '0'); --Outputs signal Dout : std_logic_vector(7 downto 0); -- Clock period definitions constant clk_period : time := 10 ns; BEGIN -- Instantiate the Unit Under Test
-
Thread
range Angabe innerhalb von case auch als hexadezimale Zahl möglich?
vom Standard unterstützt: [vhdl] case to_integer(unsigned(stdlogicvector(19 downto 0))) is when 0 to 4096 => -- ... -- ... when 4097 to ... => -- ... -- ... when others =>
hexadezimale Zahlen darzustellen. So z.B.: [vhdl] case unsigned(stdlogicvector(19 downto 0)) is when x"0" to x"1000" => -- ... -- ... when others => -- ... end case; [/vhdl] Ist sowas möglich? Vielen Dank im Voraus. zwiepack
-
Thread
Altera & ModelSim
MUX4X1; architecture VERHALTEN of MUX4X1 is begin with S select -- Auswahlsignal Y <= E(0) when "00", E(1) when "01", E(2) when "10", E(3) when "11"; end VERHALTEN;
Y : out std_logic); end MUX4X1; architecture VERHALTEN of MUX4X1 is begin Y <= E(0) when s = "00" else E(1) when s = "01" else E(2) when s = "10" else E(3) when s = "11"; end VERHALTEN; Ich habe es nur kompiliert und nicht simuliert. Tom
-
Thread
Ein- oder Zwei-Prozess-Darstellung für FSM
process (state, rst, start, stop, delay, counter) begin next_counter <= (others=>'0'); case state is when reset => next_state <= idle; when idle => if (start='1') then next_state <= work;
2. begin process begin wait until rising_edge(clk); case state is when reset => counter <= (others=>'0'); state <= idle; when idle => delay <= 0; if (start='1') then
-
Thread
Problem mit CASE Anweisung
Ich habe folgenden Code, der einen Fehler produziert, wenn ich "others" weglasse. Warum ist das so? [c] CASE counter(3 downto 0) IS WHEN "0000" => output <= out01; select <= sel01; WHEN "0001" => output <= out02; select <= sel02; (weitere cases
Woher kommt diese Zahl und warum wird das angemahnt? Es gibt doch keine "others", denn der selektierende Vektor ist wirklich nur ein "3 downto 0" Idee ?