| Author |
Message |
andy1
Joined: 24 Jul 2004 Posts: 126 Helped: 2
|
17 Dec 2004 6:00 vhdl initial |
|
|
|
|
| In Verilog, you use "Initial" block to initialize values. What would be VHDL equivalent? How do you initialize values on time in VHDL?
|
|
| Back to top |
|
 |
nand_gates
Joined: 19 Jul 2004 Posts: 907 Helped: 120
|
17 Dec 2004 6:09 initial vhdl |
|
|
|
|
In VHDL we use process statement in following way to mimic Verilog Initial block!
| Code: |
process
begin
signal_a <= '0';
signal_b <= "000000";
.........
.........
.........
wait;
end process; |
Note here the last statement here must be a "wait"
One more thing to note here that in VHDL at signals declaration
you can assign initial values.
Hope this helps!
|
|
| Back to top |
|
 |
masai_mara
Joined: 13 Aug 2004 Posts: 118 Helped: 6
|
17 Dec 2004 8:43 verilog initial |
|
|
|
|
While the above is a neat solution, you can also use the now constructinside a process like :
if (now < 1ps) then
---
--
end if
|
|
| Back to top |
|
 |
jitendra
Joined: 20 Aug 2004 Posts: 58 Helped: 3 Location: India
|
11 Jan 2005 12:05 vhdl initial values |
|
|
|
|
Hi,
There are 2-3 ways to achieve the similar results:
1.
Process statement without sensitivity list and a wait (only wait; not wait on/for etc.) statement as last statement in process.
Process statement will execute once and will be suspended on wait statement. Hence wait statement should be the last statement of process.
2. Give initial values to signals while declaration. In example below signal flag_sig will be initialized to '0'.
SIGNAL flag_sig : STD_LOGIC := '0';
Problem with this method is that initial values are generally not supported by synthesis tools, so the design behavior in actual hardware may not match with simulation results.
3. This is the best way to achieve the goal. You can say almost all the devices require Power-On Reset. As reset should be there in your design, you can specify reset values for all signals in your design. On power up, reset should be applied to chip as a result initial values are assigned to the corresponding signals.
Regards,
JItendra
|
|
| Back to top |
|
 |
Google AdSense

|
11 Jan 2005 12:05 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
mhmhmh
Joined: 21 Oct 2001 Posts: 280 Helped: 3
|
11 Jan 2005 14:35 vhdl initial |
|
|
|
|
Hi andy1
Take a look at application note from Xilinx: "Writing Efficient Testbenches"
http://www.xilinx.com/bvdocs/appnotes/xapp199.pdf
In this doc you can find info about differences in Verilog and VHDL in case of writing testbenches. All examples are in Verilog and VHDL. This should help you understand VHDL testbenches very quickly.
Cheers
|
|
| Back to top |
|
 |
sarath51
Joined: 11 Dec 2002 Posts: 143 Helped: 7
|
11 Jan 2005 18:04 vhdl initial block |
|
|
|
|
| A process block with a wait statement in the end is the best replacement for the inital block
|
|
| Back to top |
|
 |
smith_kang
Joined: 22 Jan 2005 Posts: 90 Helped: 1
|
03 Feb 2005 3:42 vhdl initial begin |
|
|
|
|
hi
you can mimic Initial block in VHDL by Process(without sensitivity list),by giving Initial value to the signal in declaration of signal and by wait statement.
|
|
| Back to top |
|
 |