Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; use ieee.numeric_std.all; entity fibonacci is port( clk, rst : in std_logic; limit : in std_logic_vector(9 downto 0); fibo_series: out std_logic_vector(9 downto 0) ); end fibonacci; architecture fibonacci of fibonacci is signal a,b,c : std_logic_vector(9 downto 0); begin process(clk,rst) begin if(rst = '1') then b <= std_logic_vector(to_unsigned(1, limit'length)); c <= std_logic_vector(to_unsigned(0, limit'length)); elsif(clk'event and clk='1') then if(c = limit) then b <= std_logic_vector(to_unsigned(1, limit'length)); c <= std_logic_vector(to_unsigned(0, limit'length)); else c<=b; b<=a; end if; end if; end process; a <= std_logic_vector(unsigned(b) + unsigned(c)); fibo_series <= c; end fibonacci;
library ieee;
use ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
use ieee.numeric_std.all;
entity testbench is
end testbench;
ARCHITECTURE behavioral of testbench is
--Input and Output definitions.
signal clk : std_logic := '0';
signal rst : std_logic := '1';
signal limit : std_logic_vector(9 downto 0);
signal fibo_series : std_logic_vector(9 downto 0);
-- Clock period definitions
constant clk_period : time := 2 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: entity work.fibonacci PORT MAP (
clk => clk,
rst => rst,
limit => limit,
fibo_series => fibo_series
);
-- Clock process definitions
clk_process :process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
testing: process
begin
rst <= '0';
limit <= std_logic_vector(to_unsigned(233, limit'length));
wait for clk_period;
end process;
END;
- 500 MHz clock is probably too fast for the simulated hardware
Ok here's what happens simulating the netlist generates clock signal, the limit signal also carries the correct value. the output remains red even if i simulate for 1000ns. XXXXXXXX i attached an image of vhdl simulation (the one that works) the last signal is what i'm having problems with. hope this explains it because i don't know hos i can explain it more.
View attachment 129258
EDIT: i don't have a snapshot of the wrong netlist simulation.
rc:/> read_hdl fibonacci.vhd
rc:/> elaborate
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'DBAHRBX1'.
: Rising edge-triggered sequential cells should have rising hold/setup checks and falling edge-triggered sequential cells should have falling hold/setup checks.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'DBAHRBX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'DBAHRBX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHRBX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHRBX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHRBX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'DLAHX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'QDBAHX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'QDBAHX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'GB' and 'D' has the 'setup_rising' value whereas the 'timing_type' for the timing arc between pins 'GB' and 'Q' has the 'falling_edge' value in library cell 'QDBAHX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHRBX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHRBX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHRBX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHSX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHSX2'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHSX3'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHX1'.
Warning : Mismatch in 'timing_type' values for setup and clock timing arcs. [LBR-420]
: The 'timing_type' for the setup check between pins 'G' and 'D' has the 'setup_falling' value whereas the 'timing_type' for the timing arc between pins 'G' and 'Q' has the 'rising_edge' value in library cell 'QDLAHX2'.
Here is the waveform from netlist simulation as you can see it does not generate the fibonacci series like the post synthesis simulation.
View attachment 129287
would you like me to include logs from cadence, ads-ee and thisisnotsam suggested i fix my rst in testbench i have no idea what to fix and how i initialized clock and reset in the testbench any guides on how i can do that ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?