I have the following scenario in verilog which i need to convert to vhdl
always if reset . . . else case . . . end case // set default values case. . . . . end case end
How do I convert this to vhdl. I am lost on what the equivalent of // set default values and the case statements after that would be in VHDL.
Didn't find your answer? Ask the community — no account required.
J
jens
Check out the VHDL Language Reference Guide.
on-line version:
formatting link
Windows help version:
formatting link
D
Dave Pollum
I'm not a Verilog person, but I do have a book that shows both VHDL and Verilog code ("HDL Chip Design", by Douglas J. Smiths). The book shows that "//" is a Verilog comment. So, "// set default values" is a comment. The Verilog "default" is the same as the VHDL "when others =>". "always@ .. end" is the same as a VHDL "process .. end process". In your case (no pun intended), it's a combinatorial process. HTH
-Dave Pollum
A
Andy
The presence of "if reset" could imply that this is a clocked process, not combinatorial. We can't tell because the "always" statement is not included, and we cannot tell if the block is also sensitive to posedge clock.
Andy
F
FP
//
I have 2 case statement in 1 always loop in my verilog file. I am not sure how this should be implemented in VHDL. I am aware of the syntax. =46rom design point of view I am not sure if I should be putting them in
2 seperate process statements.
Verilog =3D>
always @ posedge clk c1 : case(cmd) is when a =3D> bunch of statements when b =3D> bunch of statements when c =3D> bunch of statements when d =3D> bunch of statements default =3D> bunch of statements end case c1
c2 : case(cmd) is when a =3D> bunch of statements when b =3D> bunch of statements when c =3D> bunch of statements when d =3D> bunch of statements default =3D> bunch of statements end case c2
end
My question is
1) Is the VHDL equivalent of the above, 2 case statements in one process or 2 different processes with 1 case each? The problem with 2 processes I am facing is access of varaibles.
2) The above is similar to an FSM. One case statement is executing the present command, while the other is completing the last command. Any idea on how this should be converted to VHDL?
M
Mike Treseler
No. One verilog block is one vhdl process.
one process
Did the verilog version work?
-- Mike Treseler
F
FP
The verilog code works but I havent deisnged it. So, I am not sure how its implementation in VHDL woould be.
M
Mike Treseler
Unless you post the code, neither am I.
-- Mike Treseler
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.