electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

What's VHDL equivalent to Verilog "Initial" block


Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> What's VHDL equivalent to Verilog "Initial" block
Author Message
andy1



Joined: 24 Jul 2004
Posts: 126
Helped: 2


Post17 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


Post17 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


Post17 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


Post11 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
Google Adsense




Post11 Jan 2005 12:05   

Ads




Back to top
mhmhmh



Joined: 21 Oct 2001
Posts: 280
Helped: 3


Post11 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


Post11 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


Post03 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
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design -> What's VHDL equivalent to Verilog "Initial" block
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Best way to go from VHDL to "System Verilog"/" (3)
What's the meaning of 'WAT", "BEOL" and & (3)
what's the difference between "DIFF" and "NIM (2)
folding Verilog("begin"-"end") code in G (1)
what's difference of "Driven Modal" and "Driv (1)
a VHDL error "Operator"+"is not defined for s (3)
Block Coding for "waveform encoder" (such as DCT) (1)
How to use "From Workspace Block" in Simulink??? (3)
Problem using "From Workspace" Block in Simulink?? (4)
what's the difference between "implant" & &quo (1)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS