Altera_Forum
Honored Contributor
19 years agoNios custom component I/0 problem in DE2
Hi all,
I have added a simple component using SOPC Builder. The signals of the component are as follows Port (
clk : in std_logic;
reset : in std_logic;
cs : in std_logic;
wr : in std_logic;
din : in std_logic_vector(31 downto 0);
rd : in std_logic;
dout : out std_logic_vector(31 downto 0) ); I assigned clk and reset to global signals clk and reset. cs, wr, din are assigned to chipselect, write and writedata of avalon_slave_0 interface and rd, dout to read and readdata signals of avalon_slave_1 interface. I perform input when cs and wr are high. But i find that cs and wr are never going high. I use following code to perform input and output. en <= cs and wr;
--Process for Input and output
process ( en, clk, reset)
begin
if (reset = '1') then
data_in <= (others => '0');
elsif (clk'event and clk='0') then
if ( en = '1') then
data_in <= din;
end if;
dount <= data_in;
end I access the custom logic using a C program. I run uClinux on the top of Nios processor. My C application runs on uClinux. My C program is very simple and just writes and reads the data. Program is shown below main()
{
int *p,*u;
int i,k=0;
p = 0x0090002C;
u = 0x00900098;
for ( i = 0; i < 10000; i++ )
{
*p = i;
printf(" \n Data_out: %x ", *u);
}
} the same setup was working on stratix1s10 board. But it is not working on DE2 board. I tried read and write wait cycles of 0 and 1 for avalon interface. I tried sampling on negitive edge and also tried on positive edge. Nothing is working. Can anyone help me.