- type state_type is (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,reset);
+ component mcpwm is
+ generic (
+ pwm_width: natural
+ );
+ port (
+ clock: in std_logic;
+ sync: in std_logic; --flag that counter "restarts-overflows"
+ data_valid:in std_logic; --indicates data is consistent
+ failsafe: in std_logic; --turn off both transistors
+ en_p, en_n: in std_logic; --enable positive & enable shutdown
+ match: in std_logic_vector (pwm_width-1 downto 0); --posion of counter when we swap output logic
+ count: in std_logic_vector (pwm_width-1 downto 0); --we use an external counter
+ out_p, out_n: out std_logic --pwm outputs: positive & shutdown
+ --TODO add the rest of pwm signals, swap match to pwm_word
+ );
+ end component;
+
+ component div8 is
+ port (
+ --reset: in std_logic;
+ clk_in: in std_logic;
+ clk_out: out std_logic
+ );
+ end component;
+
+
+ type state_type is (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,f15,r15,reset,rst_wait);