1 |
2 |
azmathmoos |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// Copyright (C) 2014-2015 Azmath Moosa ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This source file may be used and distributed without ////
|
6 |
|
|
//// restriction provided that this copyright statement is not ////
|
7 |
|
|
//// removed from the file and that any derivative work contains ////
|
8 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// This source file is free software; you can redistribute it ////
|
11 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
12 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
13 |
|
|
//// either version 3 of the License, or (at your option) any ////
|
14 |
|
|
//// later version. ////
|
15 |
|
|
//// ////
|
16 |
|
|
//// This source is distributed in the hope that it will be ////
|
17 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
18 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
19 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
20 |
|
|
//// details. ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
23 |
|
|
//// Public License along with this source; if not, download it ////
|
24 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
25 |
|
|
//// ////
|
26 |
|
|
//////////////////////////////////////////////////////////////////////
|
27 |
|
|
`timescale 1ns / 1ps
|
28 |
|
|
`include "Configuration.v"
|
29 |
|
|
`include "Programming.v"
|
30 |
|
|
|
31 |
|
|
module Inst_Mem(
|
32 |
|
|
input [0:`pc_w] inst_addr,
|
33 |
|
|
input Clk,
|
34 |
|
|
output [0:`inst_w] inst
|
35 |
|
|
);
|
36 |
|
|
|
37 |
|
|
reg [0:`inst_w] instruction [0:15];
|
38 |
|
|
reg [0:`inst_w] instb;
|
39 |
|
|
|
40 |
|
|
initial begin
|
41 |
|
|
instruction[0] = {`iLoad_RI,`dR3,6'd2};
|
42 |
|
|
instruction[1] = {`iAdduOP_RRI,5'd0,`R3,3'd0};
|
43 |
|
|
instruction[2] = {`iLoad_RI,`dR2,6'd1};
|
44 |
|
|
instruction[3] = {`iAddVector_RI,`dR1,6'd11};
|
45 |
|
|
instruction[4] = {`iAddVector_RI,`dR0,6'b11111100};
|
46 |
|
|
instruction[5] = {`iLoad_RI,`dR1,6'd0};
|
47 |
|
|
instruction[6] = {5'd0,`dR0,`R1,`R2};
|
48 |
|
|
instruction[7] = {`iStore_sRI,`dR0,6'd3};
|
49 |
|
|
instruction[8] = {`iBranch_RI,`ulnk,`bALL,6'd4};
|
50 |
|
|
instruction[9] = {16'hFFFF};
|
51 |
|
|
instruction[10] = {6'd8,`dR0,`R1,`R2};
|
52 |
|
|
instruction[11] = {`iADD_RRR,`dR3,`R2,`R1};
|
53 |
|
|
instruction[12] = {`iBranch_RI,`bRET,6'd0};
|
54 |
|
|
instruction[13] = {`iAND_RRI,`dR2,`R2,3'd1};
|
55 |
|
|
instruction[14] = {`iOR_RRI,`dR2,`R2,3'd1};
|
56 |
|
|
instruction[15] = {`iXOR_RRI,`dR2,`R2,3'd1};
|
57 |
|
|
end
|
58 |
|
|
|
59 |
|
|
assign inst = instruction[inst_addr];
|
60 |
|
|
|
61 |
|
|
endmodule
|