- What are the two key concepts in the simulation semantics of VHDL and how does each concept help VHDL simulation produce waveforms that match the behaviour that we expect?
- What is the advantage of RTL simulation in comparison to simulation as defined by the VHDL standard?
- What is the disadvantage of RTL simulation in comparison to simulation as defined by the VHDL standard?
- For each of the architectures muruku 1. . . muruku 4, answer the following questions.
- INSTRUCTIONS:
- Is the code legal VHDL?
- If the code is legal VHDL:
- Answer whether the behaviour of the signal z has the same behaviour as in the main architecture of sumit.
- Answer whether the code is synthesizable.
- If the code is synthesizable, answer whether it adheres to good coding practices.
entity sumit is
port (
a, b, clk : in std_logic;
z : out std_logic
);
end sumit;
architecture main of sumit is
signal m : std_logic;
begin
process ( clk )
begin
if rising_edge( clk ) then
m <= a or b; end if; end process; process ( clk ) begin if rising_edge( clk ) then z <= not m; end if; end process; end main;
port (
a, b, clk : in std_logic;
z : out std_logic
);
end sumit;
architecture main of sumit is
signal m : std_logic;
begin
process ( clk )
begin
if rising_edge( clk ) then
m <= a or b; end if; end process; process ( clk ) begin if rising_edge( clk ) then z <= not m; end if; end process; end main;
- Muruku 1
- architecture muruku_1 of sumit is
signal m : std_logic;
begin
process ( clk )
begin
if rising_edge( clk ) then
m <= a or b; z <= not m; end if; end process; end muruku_1; - Muruku_X
- architecture muruku_X of sumit is
signal m, p : std_logic;
begin
process ( clk )
begin
if rising_edge( clk ) then
m <= a or b; end if; end process; process ( clk ) begin if rising_edge( clk ) then z <= p; end if; end process; p <= not m; end muruku_X; - Muruku_2
- architecture muruku_2 of sumit is
signal m, p : std_logic;
begin
if (a or b) = ’1’ generate
m <= ’1’; end generate; if (a or b) = ’0’ generate m <= ’0’; end generate; process ( clk ) begin if rising_edge( clk ) then p <= m; end if; end process; process ( clk ) begin if rising_edge( clk ) then z <= not p; end if; end process; end muruku_2; - Muruku_3
- architecture muruku_3 of sumit is
begin
process
begin
wait until rising_edge(clk);
wait until rising_edge(clk);
z <= not (a or b); end process; end muruku_3; - Muruku_4
- architecture muruku_4 of sumit is
signal m, p : std_logic;
begin
process ( clk )
begin
if rising_edge( clk ) then
m <= a or b; end if; end process; process ( clk ) begin if rising_edge( clk ) then p <= m; end if; end process; z <= not p; end muruku_4;
hi do you have solutions to this qn? hope to hearfrom you soon,
ReplyDeletesara
Instead of putting up the solution directly i feel it would be better to come up with some intermediate solution which you think of and we can discuss from there...
ReplyDeletesumit looks 'crap' but is valid VHDL.
ReplyDeleteinfers two register, register m, and register z.
BTW: All have crap layout, DON'T layout your VHDL like this example.
Muruku 1 will produce the same two registers;
Muruku X , signal p is outside the process, so imposes a delta, but is valid , and will produce the same,
Muruku 2, is such crap layout, I'd have to write it out to see what the hell is going on. At first look, the generates seem to be trying to produce the same set of registers, but it's such crazy VHDL I'd have to really study it, which is not the aim of VHDL.
Muruku 3, again crazy VHDL, the wait until would normally imply you are after a register, but cascaded like that, crazy idea. Who knows what the synthesiser or compiler would do.
Muruku 4, don't know.
But I'd say one thing to people that are looking at this.
The reason for VHDL is to get reliable gates at the end. You want your simulator and synthesiser to get the same output.
Now simulators are very dumb, sorry to Modelsim et all, but they can and do simulate code that can't be made into chips.
Synthesisers are / try to be clever. They effectively match 'patterns' in your VHDL to generate the gates / functions they need.
Learn to write your code in formats that simulators and synthesisers can understand easily. This will save you hours of time. The simulator will agree with the synthesised results, and they will both run faster.