Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # command chain to force
- force A 0
- force B 0
- run
- force B 1
- run
- force A 1
- force B 0
- run
- force B 1
- run
- # test bench
- library IEEE;
- use IEEE.std_logic_1164.all;
- entity gate_tb is
- end entity gate_tb;
- architecture test of gate_tb is
- component []
- port (
- A : in std_logic;
- B : in std_logic;
- Y : out std_logic);
- end component;
- signal A, B, O : std_logic;
- begin
- gate_map: [] port map (A => A, B => B, Y => O);
- process begin
- A <= '0';
- B <= '0';
- wait for 100 ps;
- A <= '0';
- B <= '1';
- wait for 100 ps;
- A <= '1';
- B <= '0';
- wait for 100 ps;
- A <= '1';
- B <= '1';
- wait for 100 ps;
- end process;
- end test;
Advertisement
Comments
-
- inputs = ['A', 'B', 'Cin']
- inputs = inputs[::-1]
- n = len(inputs)
- for i in range(2**n):
- for j in range(n):
- if i % (2**j) == 0:
- print(f"force {inputs[j]} {i//(2**j) % 2}")
- print("run")
Add Comment
Please, Sign In to add comment
Advertisement