I am new to VHDL, so I have developed some code for a Ring Oscillator using the internal clock of my board, but I want to add a 2nd One using the internal clock, but I have some issues with understanding how to go by it. The first one works perfectly normal, however when I tried adding the second one numerous times, I had issues with the output. I also want to XOR both outputs and store them in the vector I have in my code, but I have been struggling as into why it doesn't work.
Below is my code for my ring oscillator using the internal clock, I also included the external clock in the entity so my question is, is it just as so just calling it within the process.
`
`library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_unsigned.ALL;
entity RO_TRNG is
Port ( trn : out std_logic_vector(20 downto 0);
reset : in STD_LOGIC;
sample: in STD_LOGIC;
clk : in std_logic);
end entity RO_TRNG;
architecture Behavioral of RO_TRNG is
component iclk is
port(
iclk_clk : out std_logic;
iclk_en_oscena : in std_logic);
end component;
signal ring : std_logic_vector(20 downto 0):= "100101101011011101001";
signal clk_int : std_logic;
attribute KEEP : string;
attribute KEEP of ring : signal is "true";
begin
u0 : COMPONENT iclk port map (iclk_clk=>clk_int,iclk_en_oscena=>'1');
assert ring'length mod 2 = 1 report "Length of ring must be an odd number!" severity failure;
trn <= ring when sample ='0';
process (clk_int,ring,reset) begin
if reset='0' then
ring <= "100101101011011101001";
else
if rising_edge(clk_int) then
for i in ring'range loop
if i = ring'left then
ring(i) <= not ring(0) after 1ns;
else
ring(i) <= not ring(i+1) after 1ns;
end if;
end loop;
end if;
end if;
end process;
end Behavioral;
``
I tried various attempts to call it within the process, but it seems not to work. I believe it may have to do with where i placed it in the code.