OpenCores
URL https://opencores.org/ocsvn/pavr/pavr/trunk

Subversion Repositories pavr

[/] [pavr/] [trunk/] [src/] [test_pavr_control_interrupts.vhd] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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 tests pAVR's interrupts.
38
-- NOT DONE YET.
39
-- </File info>
40
 
41
 
42
 
43
-- <File body>
44
library ieee;
45
use ieee.std_logic_1164.all;
46
library work;
47
use work.std_util.all;
48
use work.pavr_util.all;
49
use work.pavr_constants.all;
50
 
51
 
52
entity test_pavr_rf is
53
end;
54
 
55
 
56
architecture test_pavr_rf_arch of test_pavr_rf is
57
   signal clk, res, syncres: std_logic;
58
 
59
   -- Clock counter
60
   signal cnt: std_logic_vector(7 downto 0);
61
 
62
begin
63
 
64
   generate_clock:
65
   process
66
   begin
67
      clk <= '1';
68
      wait for 50 ns;
69
      clk <= '0';
70
      wait for 50 ns;
71
   end process generate_clock;
72
 
73
 
74
   generate_reset:
75
   process
76
   begin
77
      res <= '0';
78
      wait for 100 ns;
79
      res <= '1';
80
      wait for 110 ns;
81
      res <= '0';
82
      wait for 1 ms;
83
   end process generate_reset;
84
 
85
 
86
   generate_sync_reset:
87
   process
88
   begin
89
      syncres <= '0';
90
      wait for 300 ns;
91
      syncres <= '1';
92
      wait for 110 ns;
93
      syncres <= '0';
94
      wait for 1 ms;
95
   end process generate_sync_reset;
96
 
97
 
98
   test_main:
99
   process(clk, res, syncres,
100
           cnt,
101
           pavr_rf_rd1_addr,
102
           pavr_rf_rd2_addr,
103
           pavr_rf_wr_addr, pavr_rf_wr_di,
104
           pavr_rf_x_di,
105
           pavr_rf_y_di,
106
           pavr_rf_z_di
107
          )
108
   begin
109
      if res='1' then
110
         -- Async reset
111
 
112
         cnt <= int_to_std_logic_vector(0, cnt'length);
113
      elsif clk'event and clk='1' then
114
         -- Clock counter
115
         cnt <= cnt+1;
116
 
117
         -- Initialize inputs.
118
 
119
         case std_logic_vector_to_nat(cnt) is
120
 
121
            -- TEST 1
122
 
123
 
124
            when others =>
125
               null;
126
         end case;
127
 
128
         if syncres='1' then
129
            -- Sync reset
130
 
131
            cnt <= int_to_std_logic_vector(0, cnt'length);
132
         end if;
133
      end if;
134
   end process test_main;
135
 
136
 
137
end;
138
-- </File body>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.