Solve VHDL Synthesis Questions: Learn to Write & Synthesize Code

  • Thread starter Thread starter Tracy_sysu
  • Start date Start date
  • Tags Tags
    Synthesis
Click For Summary

Discussion Overview

The discussion revolves around synthesizing VHDL code, specifically addressing errors encountered in various code fragments and processes. Participants seek clarification on synthesis issues, error messages, and the behavior of different VHDL constructs.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant presents a VHDL code fragment and requests help with synthesis errors, specifically related to a process without a sensitivity list.
  • Another participant explains the importance of a sensitivity list in VHDL processes, noting that without it, the process will not execute on variable changes.
  • A participant shares their code for process S5 and the error messages received during synthesis, questioning the cause of the errors.
  • Some participants suggest that the issue may stem from attempting to update a register on both the rising edge of the clock and in the else clause, which could lead to synthesis problems.
  • There is a mention that registers can only be sensitive to one edge of the clock signal, indicating a potential source of the synthesis error in the provided code.

Areas of Agreement / Disagreement

Participants generally agree that the synthesis errors are likely due to the handling of clock edges in the VHDL code. However, there is no consensus on the exact nature of the problem or the best approach to resolve it, as different interpretations of VHDL behavior are presented.

Contextual Notes

Limitations include potential misunderstandings of VHDL synthesis rules and the specific capabilities of the synthesis tool being used (Quartus II). The discussion does not resolve the underlying issues with the code or the synthesis process.

Who May Find This Useful

Individuals studying VHDL, particularly those interested in synthesis issues and error resolution, as well as those working on related homework or projects in digital design.

Tracy_sysu
Messages
3
Reaction score
0
Hello, everyone!Now I'm studying VHDL, and our teacher gave us some questions as follows:
1. Complete the following code fragment and try to synthesize the VHDL:
process begin
wait until Clk = '1';
Phase <= "0" after 0 ns; Phase <= "1" after 10 ns;
end process;
What is the error message? Synthesize this code, and explain the results:
process begin
wait until Clk_x_2 = '1';
case (Phase) is
when '0' => Phase <= '1'; when others => Phase <= '0';
end case;
end process;

2.Consider the following processes:
S1: process (clk) begin
if clk'EVENT and clk = '1' then count <= count + inc; end if;
end process;
S2: process (clk) begin
if rst = '1' then count <= 0;
elsif clk'EVENT and clk = '1' then count <= count + inc;
end if;
end process;
S3: process (clk, rst) begin
if rst = '1' then count <= 0; elsif clk'EVENT and clk = '1' then
count <= count + inc; sum <= count + sum;
end if;
end process;
S4: process (clk) begin
if clk'EVENT and clk = '1' then if rst = '1' then count <= 0;
else count <= count + inc; end if;
end if;
end process;
S5: process (clk, rst) begin
if rst = '1' then count <= 0;
elsif clk'EVENT and clk = '1' then count <= count + inc;
else count <= count + 1;
end if;
end process;
S6: process (clk, rst) begin
if rst = '1' then count <= 0;
elsif clk'EVENT and clk = '1' then count <= count + inc;
end if; inc <= not dec;
end process;
Write code to drive each of these processes and simulate them. Explain any errors or problems you encounter. Try to synthesize your code and check that the results behave correctly and match the simulation results. Explain any differences in behavior or any problems you encounter.

For these two questions, I have n o idea about them, is there anyone could help me?
 
Engineering news on Phys.org
1) A process without a sensitivity list is useless. If you don't know what the sensitivity list does...well...the way I think of it is: if there is a change on the variables in the sensitivity list, the process will execute. example:

Process(A)
begin
X <= B and A;
end process;

that means that if B changes at any time...nothing will happen..if X changes at any time nothing will happen...but if A changes...X gets updated (the process executes)
 
Thanks for your help
I have finished part of them,but I met one problem when I write VHDL to test code s5
Here is my code and the error message( I used Quartus II version 7.0 to synthesis):
 for s5
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity cnt4 is
Port (clk : in std_logic;
rst: in std_logic;
inc: in std_logic_vector(3 downto 0);
count: buffer std_logic_vector(3 downto 0));
end entity cnt4;

architecture Behavioral of cnt4 is
begin process (clk, rst)
begin
if rst = '1' then
count <= "0000";
elsif clk'EVENT and clk = '1' then
count <= count + inc;
else
count <= count + "0001";
end if;
end process;
end Behavioral;

The error message is
Error (10818): Netlist error at cnt4.vhd(15): can't infer register for count[0] because it does not hold its value outside the clock edge
Error (10818): Netlist error at cnt4.vhd(15): can't infer register for count[1] because it does not hold its value outside the clock edge
Error (10818): Netlist error at cnt4.vhd(15): can't infer register for count[2] because it does not hold its value outside the clock edge
Error (10818): Netlist error at cnt4.vhd(15): can't infer register for count[3] because it does not hold its value outside the clock edge
Error (10822): HDL error at cnt4.vhd(17): couldn't implement registers for assignments on this clock edge

I want to know what's the problem?It seems to me everything is all right :(
 
I'm no expert here, that's for sure. but from my experience, many devices can't support dual clocking styles. But in theory VHDL can do a lot of things that a particular device can't do. I think the problem with this code is that you're trying to update a register (buffer in this case) on both a rising clock edge AND else (basically a falling clock edge). With most devices it's either one or the other, but not both in a single process.
 
A register can be sensitive for only 1 edge of the clock signal.But in that code we deal with both rising edge and declining edge(or others),i think that is the problem.^_^
 
Thanks for all of your help and your patient and kindness! I don't know how to express that,Thank you!
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
11K
  • · Replies 1 ·
Replies
1
Views
12K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
12K
Replies
1
Views
9K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K