Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21607 Discussions

Vhdl code for IP_IRQ component!

Altera_Forum
Honored Contributor II
1,166 Views

Hi, I need help for Vhdl code for designing one IP component, small device drivers and test demonstration that give a periodic interrupt to sierra every second. 

"SEE ATTACHMENT" 

 

 

Component level interface (VHDL) is: 

 

PORT (  

addr : IN std_logic_vector(1 downto 0);  

clk : IN std_logic;  

cs_n : IN std_logic;  

read_n : IN std_logic;  

din : IN std_logic_vector(31 DOWNTO 0);  

reset_n : IN std_logic;  

write_n : IN std_logic;  

dout : OUT std_logic_vector(31 DOWNTO 0);  

irq_out_n : out std_logic_vector(1 downto 0) ) ; 

END; 

I attached also a vhdl code(IP_IRQ) that i wrote but is not working. I don’t know what’s wrong. 

0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
503 Views

 

--- Quote Start ---  

Hi, I need help for Vhdl code for designing one IP component, small device drivers and test demonstration that give a periodic interrupt to sierra every second. 

"SEE ATTACHMENT" 

 

 

Component level interface (VHDL) is: 

 

PORT (  

addr : IN std_logic_vector(1 downto 0);  

clk : IN std_logic;  

cs_n : IN std_logic;  

read_n : IN std_logic;  

din : IN std_logic_vector(31 DOWNTO 0);  

reset_n : IN std_logic;  

write_n : IN std_logic;  

dout : OUT std_logic_vector(31 DOWNTO 0);  

irq_out_n : out std_logic_vector(1 downto 0) ) ; 

END; 

I attached also a vhdl code(IP_IRQ) that i wrote but is not working. I don’t know what’s wrong. 

 

--- Quote End ---  

 

 

 

Hi, 

 

can you describe your problem a little bit more ? I could see at least one problem.  

irq_out_n(1) is only set in the reset branch. I would assume that Quartus would 

generate a latch for irq_out_n(1). 

 

Kind regards 

 

GPK
0 Kudos
Altera_Forum
Honored Contributor II
503 Views

a couple of things: 

 

dont use std_logic_unsigned/signed/arith at the same time as ieee.numeric_std. I recommend using numeric_std. 

 

you cant compare a std_logic vector to a integer literal, you have to compare it to a string. For a hex string you need to write x"5e7". A std_logic_vector is NOT an integer, its a collection of bits.
0 Kudos
Reply