I am trying to generate 3 different clocks with different periods using a fork join. even period =main/2 and odd period =main/3. When I execute this code, clka and clkb are toggling with same period as clkc (odd period) which is not expected
// this is inside a module and has the calculation for period before forever
//code to calculate periods.
#(main_period) if (reset_n==0) clka = ~clka;
#(even_period) if (reset_n==0) clkb = ~clkb;
#(odd_period) if (reset_n==0) clkc = ~clkc;
Can anybody please help understand the above behavior why all clocks are toggling with odd period?
I see the correct output if i move forever inside fork..join and keep 3 different forever blocks for each clock.