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

Subversion Repositories edge

[/] [edge/] [trunk/] [HW/] [Boards/] [Atlys/] [instruction_memory.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 heshamelma
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Instruction memory system                                   // 
4
//                                                              //
5
//  This file is part of the Edge project                       //
6
//  http://www.opencores.org/project,edge                       //
7
//                                                              //
8
//  Description                                                 //
9
//   Instruction memory system is a wrapper for an IP core      //
10
//   or unit to be used as memory to embed MIPS instructions.   //
11
//   The contents of this file are target dependent.            //
12
//                                                              //
13
//  Author(s):                                                  //
14
//      - Hesham AL-Matary, heshamelmatary@gmail.com            //
15
//                                                              //
16
//////////////////////////////////////////////////////////////////
17
//                                                              //
18
// Copyright (C) 2014 Authors and OPENCORES.ORG                 //
19
//                                                              //
20
// This source file may be used and distributed without         //
21
// restriction provided that this copyright statement is not    //
22
// removed from the file and that any derivative work contains  //
23
// the original copyright notice and the associated disclaimer. //
24
//                                                              //
25
// This source file is free software; you can redistribute it   //
26
// and/or modify it under the terms of the GNU Lesser General   //
27
// Public License as published by the Free Software Foundation; //
28
// either version 2.1 of the License, or (at your option) any   //
29
// later version.                                               //
30
//                                                              //
31
// This source is distributed in the hope that it will be       //
32
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
33
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
34
// PURPOSE.  See the GNU Lesser General Public License for more //
35
// details.                                                     //
36
//                                                              //
37
// You should have received a copy of the GNU Lesser General    //
38
// Public License along with this source; if not, download it   //
39
// from http://www.opencores.org/lgpl.shtml                     //
40
//                                                              //
41
//////////////////////////////////////////////////////////////////
42
 
43
module Instruction_Memory
44
(
45
  input CLK,
46
  input[31:0] address,
47
  output[31:0] dout,
48
  input reset
49
);
50
 
51
wire[31:0] addr;
52
wire[31:0] BRAM_ADDR;
53
 
54
assign addr = ((address) & 32'hFFFFFFFC)/4 ;
55
assign BRAM_ADDR = (addr <= 512)? addr : 0;
56
 
57
ROM32x512 ROM
58
(
59
  .clka(CLK), // input clka
60
  .addra(BRAM_ADDR), // input [9 : 0] addra
61
  .douta(dout) // output [31 : 0] douta
62
);
63
 
64
endmodule

powered by: WebSVN 2.1.0

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