Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17050 Discussions

VHDL/Modelsim question (hard assignments)

Altera_Forum
Honored Contributor II
1,595 Views

Hi experts - there must be an easy answer to this. For various reasons, in my code, and especially in my test bench, I have a lot (many dozens) of hard assignments (essentially gate-ROMs). If I just code them in-line, I have to scroll through lots and lots of line_xxxx when I browse for a signal in modelsim. But if I put all these hard assignments within a process(all), the simulator hangs(?). There's probably a better way to do this - what do you do? 

 

(Also, does anyone know why the dividers sometimes disappear in the Modelsim Wave window?) 

 

Thanks guys! 

/j
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
860 Views

nobody? (adding dummy extra length)

0 Kudos
Altera_Forum
Honored Contributor II
860 Views

 

--- Quote Start ---  

Hi experts - there must be an easy answer to this. For various reasons, in my code, and especially in my test bench, I have a lot (many dozens) of hard assignments (essentially gate-ROMs). If I just code them in-line, I have to scroll through lots and lots of line_xxxx when I browse for a signal in modelsim. But if I put all these hard assignments within a process(all), the simulator hangs(?). There's probably a better way to do this - what do you do? 

--- Quote End ---  

 

 

Since the contents of a ROM wouldn't change a single assignment to the signal would be all that is needed. I would code it like this... 

 

process begin a <= '1'; b <= x0000"; ... you get the point wait; -- Unconditional wait. All of the signals have now been assigned end process;  

 

Kevin Jennings
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

Thank Kevin - what does the wait do? I never use those in RTL design coding - not sure what they're for, and Quartus often doesn't seem to like them. 

 

thanks! 

/j
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

 

--- Quote Start ---  

Thank Kevin - what does the wait do? I never use those in RTL design coding - not sure what they're for, and Quartus often doesn't seem to like them. 

 

thanks! 

/j 

--- Quote End ---  

 

 

Wait all by itself will wait forever, the process will permanently suspend. There are several flavors of wait statements... 

 

wait; -- Unconditional, waits forever 

wait until xxx; -- xxx is a boolean condition, such as 'rising_edge(clk)' or 'abc = '1' 

wait for xxx; -- xxx is type time, such as 1 ns, 10 us 

 

A process with a wait statement cannot be used with a sensitivity list, the compiler will flag it as an error for you to fix. Waits are more typically used in testbenches than synthesizable designs, however the following two forms are generally recognized as equivalent 

 

process(clk) begin if rising_edge(clk) then b <= a; end if; end process; process begin wait until rising_edge(clk); b <= a; end process;  

 

Kevin Jennings
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

If you declare these signal in your tb, you could also initialize them at declaration. 

 

constant rc_val : natural := 67; constant rom_cell : std_logic_vector(7 downto 0) := std_logic_vector(to_unsigned(rc_val, 8));
0 Kudos
Altera_Forum
Honored Contributor II
860 Views

thanks guys - will try this stuff.

0 Kudos
Reply