OpenCores
URL https://opencores.org/ocsvn/lfsr_randgen/lfsr_randgen/trunk

Subversion Repositories lfsr_randgen

[/] [lfsr_randgen/] [trunk/] [lfsr_tb.vhd] - Diff between revs 2 and 4

Show entire file | Details | Blame | View Log

Rev 2 Rev 4
Line 45... Line 45...
entity lfsr_tb is
entity lfsr_tb is
end lfsr_tb;
end lfsr_tb;
 
 
architecture behavior of lfsr_tb is
architecture behavior of lfsr_tb is
 
 
        signal width : integer :=8;     --change the width value here for a different regsiter width.
        constant width : integer :=8;     --change the width value here for a different regsiter width.
   signal clk,set_seed,out_enable : std_logic := '0';
   signal clk,set_seed : std_logic := '0';
   signal seed : std_logic_vector(width-1 downto 0) := (0 => '1',others => '0');
   signal seed : std_logic_vector(width-1 downto 0) := (0 => '1',others => '0');
   signal rand_out : std_logic_vector(width-1 downto 0);
   signal rand_out : std_logic_vector(width-1 downto 0);
   -- clock period definitions
   -- clock period definitions
   constant clk_period : time := 1 ns;
   constant clk_period : time := 1 ns;
 
 
begin
begin
 
 
        -- entity instantiation for the lfsr component.
        -- entity instantiation for the lfsr component.
   uut: entity work.lfsr generic map (width => 8)    --change the width value here for a different regsiter width.
   uut: entity work.lfsr generic map (width => width)    --change the width value here for a different regsiter width.
        PORT MAP (
        PORT MAP (
          clk => clk,
          clk => clk,
                         set_seed => set_seed,
                         set_seed => set_seed,
                         out_enable => out_enable,
 
          seed => seed,
          seed => seed,
          rand_out => rand_out
          rand_out => rand_out
        );
        );
 
 
   -- Clock process definitions
   -- Clock process definitions
Line 81... Line 80...
        wait for 10 ns;
        wait for 10 ns;
        set_seed <= '1';
        set_seed <= '1';
        wait for 1 ns;
        wait for 1 ns;
        set_seed <= '0';
        set_seed <= '0';
        wait for 20 ns;
        wait for 20 ns;
        out_enable <= '1';
 
      wait;
      wait;
   end process;
   end process;
 
 
END;
END;
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.