summaryrefslogtreecommitdiffstats
path: root/zpu/hdl/zpu4/src/io.vhd
diff options
context:
space:
mode:
Diffstat (limited to 'zpu/hdl/zpu4/src/io.vhd')
-rw-r--r--zpu/hdl/zpu4/src/io.vhd23
1 files changed, 14 insertions, 9 deletions
diff --git a/zpu/hdl/zpu4/src/io.vhd b/zpu/hdl/zpu4/src/io.vhd
index b5465d1..7dbe36f 100644
--- a/zpu/hdl/zpu4/src/io.vhd
+++ b/zpu/hdl/zpu4/src/io.vhd
@@ -19,8 +19,8 @@ entity zpu_io is
busy : out std_logic;
writeEnable : in std_logic;
readEnable : in std_logic;
- write : in std_logic_vector(7 downto 0);
- read : out std_logic_vector(7 downto 0);
+ write : in std_logic_vector(wordSize-1 downto 0);
+ read : out std_logic_vector(wordSize-1 downto 0);
addr : in std_logic_vector(maxAddrBit downto minAddrBit)
);
end zpu_io;
@@ -45,7 +45,7 @@ begin
clk => clk,
areset => areset,
we => timer_we,
- din => write,
+ din => write(7 downto 0),
adr => addr(4 downto 2),
dout => timer_read);
@@ -60,7 +60,7 @@ begin
-- timer_we <= '0';
if writeEnable = '1' then
-- external interface
- if addr=x"1000" then
+ if addr=x"2028003" then
-- Write to UART
-- report "" & character'image(conv_integer(memBint)) severity note;
print(l_file, character'val(conv_integer(write)));
@@ -68,20 +68,25 @@ begin
-- report "xxx" severity failure;
-- timer_we <= '1';
else
- report "Illegal IO write" severity failure;
+ print(l_file, character'val(conv_integer(write)));
+ report "Illegal IO write" severity warning;
end if;
end if;
- read <= (others => 'U');
+ read <= (others => '0');
if (readEnable = '1') then
if addr=x"1001" then
read <= (0=>'1', others => '0'); -- recieve empty
elsif addr(12)='1' then
- read <= timer_read;
+ read(7 downto 0) <= timer_read;
elsif addr(11)='1' then
- read <= ZPU_Frequency;
+ read(7 downto 0) <= ZPU_Frequency;
+ elsif addr=x"2028003" then
+ read <= (others => '0');
else
- report "Illegal IO read" severity failure;
+ read <= (others => '0');
+ read(8) <= '1';
+ report "Illegal IO read" severity warning;
end if;
end if;
end if;
OpenPOWER on IntegriCloud