Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

My first attempt

Hi try create simply custom component. In the pdf altera avalon specification is described MM slave. I wrote this vhdl(very simply, i try learn add component):

entity MyCustom is

port

(

clk : in std_logic;

wr : in std_logic;

write_data : in std_logic_vector(7 downto 0);

reset : in std_logic;

-- conduit

led: out std_logic_vector(7 downto 0)

);

end MyCustom;

architecture pokus of MyCustom is

begin

process(clk,reset)

begin

if (reset='0') then

led<="00000000";

elsif(clk = '1' and clk'event)then

if(wr = '1')then

led <= write_data;

else null;

end if;

end if;

end process;

end pokus;

signal from entity are the same like on example in the pdf.

i wanna only write values to output. C code is this:

# include <stdio.h>

# include <system.h>

# include <io.h>

int main()

{

IOWR(0x00011018,0,0x0f);

return 0;

}

But it doesnt work, is that wrong way?

Thanks, Vaclav