]> rtime.felk.cvut.cz Git - fpga/pwm.git/commitdiff
PWM selection signal added.
authorVladimir Burian <buriavl2@fel.cvut.cz>
Thu, 26 May 2011 20:39:38 +0000 (22:39 +0200)
committerVladimir Burian <buriavl2@fel.cvut.cz>
Thu, 26 May 2011 20:39:38 +0000 (22:39 +0200)
pwm.vhd
tb/tb_pwm.vhd

diff --git a/pwm.vhd b/pwm.vhd
index 4ac8765f48e1ece55a00f0b2bb3c7d2262d29b9d..a0a9673e8fa84af494f3729f3e657ab19349dd7d 100644 (file)
--- a/pwm.vhd
+++ b/pwm.vhd
@@ -30,6 +30,7 @@ entity pwm is
     clk     : in  std_logic;
     reset   : in  std_logic;
     din     : in  std_logic_vector (PWM_WIDTH-1 downto 0);
+    sel     : in  std_logic;
     we      : in  std_logic;
     -- PWM interface
     pwm_cnt : in  std_logic_vector (PWM_WIDTH-1 downto 0);
@@ -57,7 +58,7 @@ begin
       if reset = '1' then
         reg <= (others => '0');
       else
-        if we = '1' then
+        if we = '1' and sel = '1' then
           reg <= din;
         end if;
       end if;
index e77fd47f1434d7d53f8952ed8dfb01756b093e9c..8cead0dd22309374c8598ebbcef718f49947bb91 100644 (file)
@@ -37,6 +37,7 @@ begin
       clk     => clk,
       reset   => reset,
       din     => din,
+      sel     => '1',
       we      => we,
       pwm_cnt => pwm_cnt,
       pwm_cyc => pwm_cyc,