Discover why your perfect simulation might never become a real chip--and how to fix that!
Synthesizable vs non-synthesizable constructs in VHDL - When to Use Which
Imagine you want to design a digital circuit using VHDL. You write code that looks perfect and simulates well on your computer. But when you try to turn that code into a real chip, it fails or behaves unexpectedly.
This happens because some parts of your code cannot be turned into hardware by the synthesis tool.
Writing VHDL without knowing which parts can be synthesized is like writing a recipe with ingredients you can't find in the store. You waste time debugging, and your design might never work on real hardware.
Manual trial and error is slow and frustrating because simulation success does not guarantee hardware success.
Understanding the difference between synthesizable and non-synthesizable constructs helps you write VHDL code that can be reliably turned into hardware.
This knowledge guides you to use only hardware-friendly code for synthesis, while keeping testbench or simulation-only code separate.
process begin wait for 10 ns; signal <= '1'; end process;
process(clk) begin if rising_edge(clk) then signal <= '1'; end if; end process;
It enables you to create real, working digital circuits from your VHDL code without surprises.
When designing a traffic light controller, using synthesizable constructs ensures the lights change correctly on the actual hardware, not just in simulation.
Not all VHDL code can be turned into hardware.
Knowing synthesizable constructs saves time and frustration.
It helps you build real circuits that work as expected.
Practice
Solution
Step 1: Identify synthesizable constructs
Synthesizable code must describe hardware behavior, typically using clocked processes without delays or waits.Step 2: Analyze each option
A process with only clocked assignments and no wait statements uses clocked assignments without waits, so it is synthesizable. Options A, B, and D use waits, assertions, or file I/O, which are non-synthesizable.Final Answer:
A process with only clocked assignments and no wait statements -> Option DQuick Check:
Synthesizable = clocked process without wait [OK]
- Thinking wait statements are synthesizable
- Confusing assert for hardware logic
- Assuming file I/O can be synthesized
Solution
Step 1: Understand wait statement restrictions
Wait statements likewait until clk = '1';are not synthesizable because hardware cannot implement arbitrary waits.Step 2: Check other options
Options A, B, and C are standard synthesizable constructs: clock edge detection, signal assignments in processes, and concurrent assignments.Final Answer:
A process with a wait until clk = '1'; statement -> Option AQuick Check:
Wait statements = non-synthesizable [OK]
- Assuming wait until is synthesizable
- Confusing sensitivity list with wait statements
- Thinking concurrent assignments are non-synthesizable
process(clk)
begin
if rising_edge(clk) then
if reset = '1' then
q <= '0';
else
q <= d;
end if;
end if;
end process;Solution
Step 1: Analyze reset behavior inside clocked process
The reset check is inside the rising_edge(clk) condition, so reset is synchronous.Step 2: Understand output assignment timing
q is assigned '0' only on clock edge when reset is '1', otherwise q follows d on clock edges.Final Answer:
q synchronously resets to '0' on clock edge when reset is '1' -> Option AQuick Check:
Synchronous reset inside clock edge = q synchronously resets to '0' on clock edge when reset is '1' [OK]
- Thinking reset is asynchronous here
- Assuming q changes immediately without clock
- Ignoring the rising_edge condition
process(clk) begin wait until clk = '1'; q <= d; end process;
Solution
Step 1: Check for wait statement usage
Wait statements inside processes are not synthesizable and cause synthesis errors.Step 2: Verify other syntax elements
The process has a sensitivity list (clk), signal assignment is inside process, and <= is correctly used.Final Answer:
Using wait statement inside a clocked process -> Option CQuick Check:
Wait inside process = synthesis error [OK]
- Ignoring that wait is not synthesizable
- Confusing sensitivity list with wait usage
- Thinking <= operator is wrong here
Solution
Step 1: Identify testbench constructs
Testbenches often usewait forstatements to simulate timing delays, which are non-synthesizable.Step 2: Compare with synthesizable constructs
Options A, C, and D describe synthesizable hardware behavior, not simulation-only code.Final Answer:
A process with wait for 20 ns; to generate clock signals -> Option BQuick Check:
Wait for delays = simulation only [OK]
- Using wait for in synthesizable design code
- Confusing testbench and design code constructs
- Assuming clocked processes are non-synthesizable
Ready to prove it?
Pass the test and this pattern moves unknown
