Hallo,
ich versuche gerade mir einen konfigurierbaren Timer mit PWM in VHDL zu
erschaffen und habe da eine Frage zu der Simulation.
Ich habe den Code
1 | Half_Prescaler <= '0' & Prescaler(Width - 1 downto 1);
|
2 |
|
3 | process begin
|
4 | if(Prescaler = "00000000") then
|
5 | Clock <= '0';
|
6 | elsif(Prescaler = "00000001") then
|
7 | Clock <= Clock_In;
|
8 | else
|
9 | wait until rising_edge(Clock_In);
|
10 | if(Clock_Counter = (to_integer(unsigned(Half_Prescaler)) - 1)) then
|
11 | Clock <= not Clock;
|
12 | Clock_Counter <= 0;
|
13 | else
|
14 | Clock_Counter <= Clock_Counter + 1;
|
15 | end if;
|
16 | end if;
|
17 | end process;
|
Dieser Code funktioniert in der Simulation aber nicht...die Simulation
bleibt bei 0ps stehen.
Wenn ich den Code nun so schreibe
1 | Half_Prescaler <= '0' & Prescaler(Width - 1 downto 1);
|
2 |
|
3 | process (Clock_In)
|
4 | begin
|
5 | if(Prescaler = "00000000") then
|
6 | Clock <= '0';
|
7 | elsif(Prescaler = "00000001") then
|
8 | Clock <= Clock_In;
|
9 | else
|
10 | if rising_edge(Clock_In) then
|
11 | if(Clock_Counter = (to_integer(unsigned(Half_Prescaler)) - 1)) then
|
12 | Clock <= not Clock;
|
13 | Clock_Counter <= 0;
|
14 | else
|
15 | Clock_Counter <= Clock_Counter + 1;
|
16 | end if;
|
17 | end if;
|
18 | end if;
|
19 | end process;
|
funktioniert die Simulation. Ist das nicht praktisch das selbe?
Oder liegt das daran, dass im ersten Beispiel keine Signale in der
Sensitivity List stehen?
Danke für eine Antwort!
Gruß
Daniel