VHDL (Xilinx ISE+ISim) の Spartan 3e ボードを使用して、ピコ秒の PWM 信号を生成しようとしています。
library ieee;
use ieee.std_logic_1164.all;
entity pwm is
port(clk : in std_logic;
pwm_out : buffer std_logic);
end entity;
architecture rtl of pwm is
begin
process (clk)
variable count : integer range 0 to 50000;
variable duty_cycle : integer range 0 to 50000;
variable flag : integer range 0 to 1;
begin
if (rising_edge(clk)) then
count := count+1;
if (count = duty_cycle) then
pwm_out <= '1';
end if;
if (count = 50000) then
pwm_out <= '0';
count := 0;
if(flag = 0) then
duty_cycle := duty_cycle+50;
else
duty_cycle := duty_cycle-50;
end if;
if(duty_cycle = 50000) then
flag := 1;
elsif(duty_cycle = 0) then
flag := 0;
end if;
end if;
end if;
end process;
end rtl;
グローバル クロック (C9) に組み込みの 50Mhz を使用していますが、シミュレーションで奇妙な動作が見られました。0ps から 1000000ps までの clk (クロック) および pwm_out (出力) は常に HIGH のように見えますが、ISim でのタイム ドメインの clk と pwm_out の両方で 1000000ps 以降には何もありません。
私がやろうとしているのは、この動作を調査して解決し、出力 (pwm_out) の頻度を増やすことです。また、どのくらいの速さ (立ち上がり/立ち下がり時間と周波数) でパルスを生成できるか (物理的な制限) についても知りたいと思います。
経験豊富なユーザーからのガイダンスをいただければ幸いです。