I want to create xored oscillators using multiple inverters. The number of oscillator and inverter should be defined in generic. I have finished 1 oscillator but I don't know how to generate the same oscillator multiple times and let them xored. this is a part of my code:
gen_ring_oscillator:
for i in 1 to NUM_INVERTER-1 generate
osc_chain(i)<= not osc_chain(i-1);
end generate;
ring_oscillator:process(osc_chain, en_oc, osc_reset)
begin
if (osc_reset = '1') then
osc_chain(0) <= '0';
elsif (en_oc = '1') then
osc_chain(0) <= osc_chain(NUM_INVERTER-1);
ro_out <= osc_chain(NUM_INVERTER-1);
end if;
end process;
I have alreday used osc_chain as a signal between the inverters.
By default VHDL assumes zero delay elements. As a result, the oscillation frequency will be 1/0 = error (infinitely large). This will cause an "maximum number of iterations reached" error
Thus you will have to configure the component delay manually, by adding
after x nswith your assignment.More information can be found here and here.
Complete example (with some variation in delay):
Note: for a ring oscillator to work, you need an odd number of inverters.