this is a simply clock divider , and this my component i want to
integrate in my system by SOPC .
I added I3,I4,I5 just to see what appen in sopc builder
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity provaprogetto2 is
Port(
clk:in STD_LOGIC;
I1:IN STD_LOGIC;
I2:IN STD_LOGIC;
I3:in unsigned(31 downto 0);
I4:in unsigned(31 downto 0);
I5:in unsigned(31 downto 0);
I6:in unsigned(31 downto 0);
O1:OUT STD_LOGIC;
O2:OUT STD_LOGIC);
end entity provaprogetto2;
architecture div_clock of provaprogetto2 is
signal clk_cnt : unsigned(32 downto 0);
signal mem:STD_LOGIC;
signal sec:unsigned(7 downto 0);
signal min:unsigned(32 downto 0);
begin
process(clk,I2)
begin
if (I2='0') then
clk_cnt<="000000000000000000000000000000000";
mem<='0';
sec<="00000000";
min<="000000000000000000000000000000000";
O2<='1';
elsif (clk='1') and (clk'event) then
if (clk_cnt=33000000) then
clk_cnt<="000000000000000000000000000000000";
mem<=not mem;
min<=min+1;
if(min=2) then
O2<='1';
end if;
else clk_cnt<=clk_cnt+1;
end if;
if(min=60) then
O2<='0';
min<="000000000000000000000000000000000";
end if;
end if;
end process;
--O2<=I1;
O1<=mem;
end architecture div_clock;
When i import this component , SOPC got an address memory
base=0x00000800 and end=0x00000803
I declare my inputs "I1,....I5" like address or writedata , or readdata
I declare different way to see what happen , ...but nothing happen
I generate and SOPC told me "Ok , all generates whitout problems "
Ok ,i thank , but now how can i interface my component input I1....I5 with my application IDE Nios II ?
Ok i must to write header files and driver files , but wich addrress i need to use , for example for I1 (it's a bool ) where i find it ?
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
I think it's difficult to explain , now i want to finish to read Quartus II
Volume 4 SOPC Builder
thank to everydody
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif
ciao
walter