1 |
4 |
doru |
-- <File header>
|
2 |
|
|
-- Project
|
3 |
|
|
-- pAVR (pipelined AVR) is an 8 bit RISC controller, compatible with Atmel's
|
4 |
|
|
-- AVR core, but about 3x faster in terms of both clock frequency and MIPS.
|
5 |
|
|
-- The increase in speed comes from a relatively deep pipeline. The original
|
6 |
|
|
-- AVR core has only two pipeline stages (fetch and execute), while pAVR has
|
7 |
|
|
-- 6 pipeline stages:
|
8 |
|
|
-- 1. PM (read Program Memory)
|
9 |
|
|
-- 2. INSTR (load Instruction)
|
10 |
|
|
-- 3. RFRD (decode Instruction and read Register File)
|
11 |
|
|
-- 4. OPS (load Operands)
|
12 |
|
|
-- 5. ALU (execute ALU opcode or access Unified Memory)
|
13 |
|
|
-- 6. RFWR (write Register File)
|
14 |
|
|
-- Version
|
15 |
|
|
-- 0.32
|
16 |
|
|
-- Date
|
17 |
|
|
-- 2002 August 07
|
18 |
|
|
-- Author
|
19 |
|
|
-- Doru Cuturela, doruu@yahoo.com
|
20 |
|
|
-- License
|
21 |
|
|
-- This program is free software; you can redistribute it and/or modify
|
22 |
|
|
-- it under the terms of the GNU General Public License as published by
|
23 |
|
|
-- the Free Software Foundation; either version 2 of the License, or
|
24 |
|
|
-- (at your option) any later version.
|
25 |
|
|
-- This program is distributed in the hope that it will be useful,
|
26 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
27 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
28 |
|
|
-- GNU General Public License for more details.
|
29 |
|
|
-- You should have received a copy of the GNU General Public License
|
30 |
|
|
-- along with this program; if not, write to the Free Software
|
31 |
|
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
32 |
|
|
-- </File header>
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
-- <File info>
|
37 |
|
|
-- This defines the Program Memory needed by pAVR control-section tests.
|
38 |
|
|
-- The Program Memory is a trivial, single port, read-write RAM.
|
39 |
|
|
-- This is just a testing utility, NOT actually a test.
|
40 |
|
|
-- </File info>
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
|
|
-- <File body>
|
45 |
|
|
library work;
|
46 |
|
|
use work.std_util.all;
|
47 |
|
|
use work.pavr_util.all;
|
48 |
|
|
use work.pavr_constants.all;
|
49 |
|
|
use work.test_pavr_constants.all;
|
50 |
|
|
library ieee;
|
51 |
|
|
use ieee.std_logic_1164.all;
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
entity pavr_pm is
|
56 |
|
|
port(
|
57 |
|
|
pavr_pm_clk: in std_logic;
|
58 |
|
|
pavr_pm_wr: in std_logic;
|
59 |
|
|
pavr_pm_addr: in std_logic_vector(21 downto 0);
|
60 |
|
|
pavr_pm_di: in std_logic_vector(15 downto 0);
|
61 |
|
|
pavr_pm_do: out std_logic_vector(15 downto 0)
|
62 |
|
|
);
|
63 |
|
|
end;
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
architecture pavr_pm_arch of pavr_pm is
|
68 |
|
|
type tdata_array is array (0 to pavr_pm_len - 1) of std_logic_vector(15 downto 0);
|
69 |
|
|
signal data_array: tdata_array;
|
70 |
|
|
begin
|
71 |
|
|
process
|
72 |
|
|
begin
|
73 |
|
|
wait until pavr_pm_clk'event and pavr_pm_clk='1';
|
74 |
|
|
if pavr_pm_wr='0' then
|
75 |
|
|
pavr_pm_do <= data_array(std_logic_vector_to_nat(pavr_pm_addr));
|
76 |
|
|
else
|
77 |
|
|
data_array(std_logic_vector_to_int(pavr_pm_addr)) <= pavr_pm_di;
|
78 |
|
|
end if;
|
79 |
|
|
end process;
|
80 |
|
|
end;
|
81 |
|
|
-- </File body>
|