--=================================================================================================
-- File Name                           : stepper_theta.vhd

-- Description                         : This module implements angle generation for stepper motor
--                                       using Microstepping algorithm
-- Targeted device                     : Microsemi-SoC
-- Author                              : India Solutions Team
--
-- SVN Revision Information            :
-- SVN $Revision                       :
-- SVN $Date                           :
--
-- COPYRIGHT 2016 BY MICROSEMI
-- THE INFORMATION CONTAINED IN THIS DOCUMENT IS SUBJECT TO LICENSING RESTRICTIONS FROM MICROSEMI
-- CORP. IF YOU ARE NOT IN POSSESSION OF WRITTEN AUTHORIZATION FROM MICROSEMI FOR USE OF THIS
-- FILE, THEN THE FILE SHOULD BE IMMEDIATELY DESTROYED AND NO BACK-UP OF THE FILE SHOULD BE MADE.
--
--=================================================================================================

--=================================================================================================
-- Libraries
--=================================================================================================
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_SIGNED.ALL;

--=================================================================================================
-- stepper_theta entity declaration
--=================================================================================================
ENTITY STEPPER_THETA IS
PORT (
    -- Port List
    -- System reset
    reset_i                            : IN  STD_LOGIC;

	-- System clock
    sys_clk_i                          : IN  STD_LOGIC;

	-- Control input to enable angle generation
    enable_i                           : IN  STD_LOGIC;

    -- Control input indicates speed/position mode
    mode_i                             : IN  STD_LOGIC;

    -- Control input indicates that motor has stopped
    clear_buffer_i                     : IN  STD_LOGIC;

	--Data input for the slew count
    slew_cnt_i                         : IN  STD_LOGIC_VECTOR(17 DOWNTO 0);

	--Data input for rate limit
    rate_limit_i                       : IN  STD_LOGIC_VECTOR(17 DOWNTO 0);

	--Data input for command step number
    cmd_step_no_i                      : IN  STD_LOGIC_VECTOR(23 DOWNTO 0);

	--Data output for angle
    theta_output_o                     : OUT STD_LOGIC_VECTOR(17 DOWNTO 0);

	--Data output for number of rotor steps 
    step_count_o                       : OUT STD_LOGIC_VECTOR(23 DOWNTO 0)
);
END stepper_theta;
`protect begin_protected
`protect version=1
`protect author="author-a", author_info="author-a-details"
`protect encrypt_agent="encryptP1735.pl", encrypt_agent_info="Synplify encryption scripts"

`protect key_keyowner="Synplicity", key_keyname="SYNP05_001", key_method="rsa"
`protect encoding=(enctype="base64", line_length=76, bytes=256)
`protect key_block
ImX2Mc4f97F5JkOxtH8pDq4MiehDOEc7v6Gn+vlgWHktdUHwv+x1/v3OzRvu+NENLATcSHUgRssk
SDNinQyJ12hOycQf/fth8zxSz+He3rY9AWgrOXBS2CnM8XEC6qU0/Ubs45osGT4QJBjPUniLC3FZ
7vhVfdrK6KFoR/yUqrVmOo+bjXu+pJYNAvFXlR1u+1ZRLLdwzBUT4HItBWpZl6a72gpyXSXK+4vz
EZwiNJVAv8JQSmkFfEv5XPVQbrrYFMCYaRZBggXGC4YIeRW5xbPnlCi2HnC2d0i/XI0/I1vhqly7
ivAi0EvAFtb5GhW98ISlMH2R2VnNxFgN/cBCQg==

`protect key_keyowner="Mentor Graphics Corporation", key_keyname="MGC-VERIF-SIM-RSA-1", key_method="rsa"
`protect encoding=(enctype="base64", line_length=76, bytes=128)
`protect key_block
Aifz70eXPeL8bvgmJgfmpjcoL/y2e4F8B3vKpqXSrigfoFuapVmENH+eXoSBoPvzxo35XkwWiRa6
XJg+n0nE8AKxoe3TRdwPe8j+l0TuAO/xwLl2nddHaKFD1bi4P0xO8HTxSOcIS8FqvVHdCi8iZRtP
Trg1cPnaPOnWaVf4fRE=

`protect key_keyowner="Microsemi Corporation", key_keyname="MSC-IP-KEY-RSA", key_method="rsa"
`protect encoding=(enctype="base64", line_length=76, bytes=960)
`protect key_block
hOADr/ghCPJAj+hV10goHS5VCRuebSVcR7Iy/j/kplnGILwYN6vgCk3nefd69K6HDJ6JYYOj8Kjy
+RwFBJ+GTQs2dbgF84lcQltq8de4COs9wIuE40uTV51rM8HA14Ov8GcApE41jjVkEo4x3CpGZMJ0
eupmaZ6AZrGjdSPVx4jq8nmX6pT/R0Wo3WYku10GWpfTyl5GvfYqAznmKVU1N4rzTE6A9VW9vaL8
juLVFwAnr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", data_keyname="fpga-ip", data_method="aes128-cbc"
`protect encoding=(enctype="base64", line_length=76, bytes=12512)
`protect data_block
[encoded data, 16644 characters]
vCaw7fFWTaIwViq8mqZXBpMdOQ2o4RFWBNh2MKs=

`protect end_protected

