R
RaulGonz
Hi, i am using an actel fpga to generate pwm signal. There are these
IP cores in the libero software for you to drage and drop into your
design. I have the following .vhd code and is having a hard time
trying to write the testbench for it..
"library ieee;
use ieee.std_logic_1164.all;
entity FSM_CorePWM is
GENERIC (PWM_NUM : integer := 1);
port (PCLK, PRESET_N, PSEL, PENABLE, PWRITE: in std_logic;
DUTY_CYC: in std_logic_vector (2 downto 0);
PWM: out std_logic_vector (PWM_NUM downto 1);
PRDATA: out std_logic_vector (7 downto 0);
INT: out std_logic);
end entity FSM_CorePWM;
architecture HIERARCHICAL of FSM_CorePWM is
component FSM
port (PCLK, PRESET_N: in std_logic;
DUTY_CYC: in std_logic_vector (2 downto 0);
PADDR: out std_logic_vector (7 downto 0);
PWDATA: out std_logic_vector (7 downto 0));
end component;
component core_pwm
GENERIC (PWM_NUM : integer := 8);
port (PCLK, PRESET_N, PSEL, PENABLE,
PWRITE: in std_logic;
PADDR: in std_logic_vector(7
downto 0);
PWDATA: in std_logic_vector(7
downto 0);
PWM: out std_logic_vector
(PWM_NUM downto 1);
PRDATA: out std_logic_vector(7
downto 0);
INT: out std_logic);
end component;
signal PADDR_TOP: std_logic_vector(7 downto 0);
signal PWDATA_TOP: std_logic_vector(7 downto 0);
begin
FSM_TOP: FSM port map
(PCLK=>PCLK,PRESET_N=>PRESET_N,DUTY_CYC=>DUTY_CYC,PADDR=>PADDR_TOP,PWDATA=>PWDATA_TOP);
COREPWM_TOP: core_pwm
GENERIC MAP (PWM_NUM =>PWM_NUM)
port map
(PCLK=>PCLK,PRESET_N=>PRESET_N,PSEL=>PSEL,PENABLE=>PENABLE,PWRITE=>PWRITE,
PADDR=>PADDR_TOP,PWDATA=>PWDATA_TOP,PWM=>PWM,PRDATA=>PRDATA,INT=>INT);
end HIERARCHICAL; "
In the above, component "FSM" is another .vhd code while component
"core_pwm" is the IP core. please help to guide me how to generate the
testbench/stimulus for this.
IP cores in the libero software for you to drage and drop into your
design. I have the following .vhd code and is having a hard time
trying to write the testbench for it..
"library ieee;
use ieee.std_logic_1164.all;
entity FSM_CorePWM is
GENERIC (PWM_NUM : integer := 1);
port (PCLK, PRESET_N, PSEL, PENABLE, PWRITE: in std_logic;
DUTY_CYC: in std_logic_vector (2 downto 0);
PWM: out std_logic_vector (PWM_NUM downto 1);
PRDATA: out std_logic_vector (7 downto 0);
INT: out std_logic);
end entity FSM_CorePWM;
architecture HIERARCHICAL of FSM_CorePWM is
component FSM
port (PCLK, PRESET_N: in std_logic;
DUTY_CYC: in std_logic_vector (2 downto 0);
PADDR: out std_logic_vector (7 downto 0);
PWDATA: out std_logic_vector (7 downto 0));
end component;
component core_pwm
GENERIC (PWM_NUM : integer := 8);
port (PCLK, PRESET_N, PSEL, PENABLE,
PWRITE: in std_logic;
PADDR: in std_logic_vector(7
downto 0);
PWDATA: in std_logic_vector(7
downto 0);
PWM: out std_logic_vector
(PWM_NUM downto 1);
PRDATA: out std_logic_vector(7
downto 0);
INT: out std_logic);
end component;
signal PADDR_TOP: std_logic_vector(7 downto 0);
signal PWDATA_TOP: std_logic_vector(7 downto 0);
begin
FSM_TOP: FSM port map
(PCLK=>PCLK,PRESET_N=>PRESET_N,DUTY_CYC=>DUTY_CYC,PADDR=>PADDR_TOP,PWDATA=>PWDATA_TOP);
COREPWM_TOP: core_pwm
GENERIC MAP (PWM_NUM =>PWM_NUM)
port map
(PCLK=>PCLK,PRESET_N=>PRESET_N,PSEL=>PSEL,PENABLE=>PENABLE,PWRITE=>PWRITE,
PADDR=>PADDR_TOP,PWDATA=>PWDATA_TOP,PWM=>PWM,PRDATA=>PRDATA,INT=>INT);
end HIERARCHICAL; "
In the above, component "FSM" is another .vhd code while component
"core_pwm" is the IP core. please help to guide me how to generate the
testbench/stimulus for this.