Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit 3179602

Browse files
committed
Semiworking AES, needs final validation.
1 parent 1567bdb commit 3179602

File tree

4 files changed

+83
-69
lines changed

4 files changed

+83
-69
lines changed

aesTest/testprogram.dat

+75-61
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,56 @@
1-
20080401
2-
200f0400
1+
20080c01
2+
20160c00
3+
20150401
34
40806000
45
40806800
56
40807000
7+
00004820
8+
00005020
9+
00005820
10+
00006020
11+
20040001
12+
0000b820
613
200e0007
7-
20180006
814
000e7700
15+
21ce0001
16+
20180006
917
0018c700
10-
21ce0004
11-
23180004
12-
20090061
13-
200a0062
14-
200b0063
15-
200c0064
16-
200d0000
18+
23180001
19+
21290061
20+
00094a00
21+
21290062
22+
00094a00
23+
21290063
24+
00094a00
25+
21290064
26+
214a0065
27+
000a5200
28+
214a0066
29+
000a5200
30+
214a0067
31+
000a5200
32+
214a0068
33+
216b0069
34+
000b5a00
35+
216b0070
36+
000b5a00
37+
216b0071
38+
000b5a00
39+
216b0072
40+
218c0073
41+
000c6200
42+
218c0074
43+
000c6200
44+
218c0075
45+
000c6200
46+
218c0076
1747
ada90000
1848
21ad0004
1949
adaa0000
2050
21ad0004
2151
adab0000
2252
21ad0004
2353
adac0000
24-
40886000
2554
00000000
2655
48891000
2756
488a1800
@@ -32,49 +61,20 @@ adac0000
3261
488b4000
3362
488c4800
3463
48800800
35-
488e0000
36-
00000000
37-
08000024
38-
00000000
39-
00000000
40-
00000000
41-
00000000
42-
00000000
43-
00000000
44-
00000000
45-
00000000
46-
00000000
47-
00000000
48-
00000000
49-
00000000
50-
00000000
51-
00000000
52-
00000000
53-
00000000
54-
00000000
55-
00000000
56-
00000000
57-
00000000
58-
00000000
59-
00000000
60-
00000000
61-
00000000
62-
00000000
63-
00000000
64-
00000000
65-
00000000
66-
00000000
67-
00000000
68-
00000000
69-
00000000
70-
00000000
71-
00000000
72-
00000000
73-
00000000
74-
00000000
7564
00000000
65+
40886000
7666
00000000
7767
00000000
68+
00021140
69+
00401020
70+
00021080
71+
00421020
72+
000210c2
73+
00431020
74+
00021200
75+
000210c2
76+
00401020
77+
08000043
7878
00000000
7979
00000000
8080
00000000
@@ -94,16 +94,30 @@ adac0000
9494
00000000
9595
00000000
9696
00000000
97-
408f6000
98-
8c100000
99-
ac107000
100-
8c100004
101-
ac107000
102-
8c100008
103-
ac107000
104-
8c10000c
105-
ac107000
97+
40106800
98+
40966000
99+
00108282
100+
02048824
101+
14110005
102+
00108042
103+
1410000c
106104
40806000
107105
40886000
106+
08000043
107+
8c1a0000
108+
ac1a7000
109+
8c1a0004
110+
ac1a7000
111+
8c1a0008
112+
ac1a7000
113+
8c1a000c
114+
ac1a7000
115+
08000067
116+
14170003
117+
20170001
118+
488e0000
119+
08000079
120+
0000b820
108121
48980000
109-
08000024
122+
40956000
123+
08000043

mips_top.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module mips_top
22
(input clk, serialClk, rst, [3:0] INT, output serial, output [31:0] pc_current, instr, dmem_addr, dmem_out, rd_dm);
33
//wire [31:0] instr, alu_out, wd_dm, rd_dm;
4-
wire dmem_we;
4+
wire dmem_we, Empty_out;
55
//mips MIPS (.clk(clk), .rst(rst), .instr(instr), .rd_dm(rd_dm), .we_dm(we_dm), .pc_current(pc_current), .alu_out(alu_out), .wd_dm(wd_dm), .INT(INT));
6-
mips MIPS (.clk(clk), .rst(rst), .instr(instr), .rd_dm(rd_dm), .dmem_we(dmem_we), .pc_current(pc_current), .dmem_addr(dmem_addr), .dmem_out(dmem_out), .INT(INT));
6+
mips MIPS (.clk(clk), .rst(rst), .instr(instr), .rd_dm(rd_dm), .dmem_we(dmem_we), .pc_current(pc_current), .dmem_addr(dmem_addr), .dmem_out(dmem_out), .INT({INT[3:1], Empty_out}));
77
//imem #(32)IMEM (.a(pc_current[7:2]), .y(instr));
88
imem #(32)IMEM (.a(pc_current), .y(instr));
99
//dmem #(32)DMEM (.clk(clk), .we(we_dm), .a(alu_out), .d(wd_dm), .q(rd_dm));
1010
dmem #(32)DMEM (.clk(clk), .we(dmem_we), .a(dmem_addr), .d(dmem_out), .q(rd_dm));
1111

12-
uart_top UART (.clk(clk), .RClk(serialClk), .reset(rst), .we(dmem_we), .dataIn(dmem_out), .address(dmem_addr), .serial(serial));
12+
uart_top UART (.clk(clk), .RClk(serialClk), .reset(rst), .we(dmem_we), .dataIn(dmem_out), .address(dmem_addr), .serial(serial), .Empty_out(Empty_out));
1313

1414
//mips MIPS (.clk(clk_5KHz), .rst(rst), .instr(instr), .rd_dm(rd_dm), .we_dm(we_dm), .pc_current(pc_current), .alu_out(alu_out), .wd_dm(wd_dm));
1515
//dmem #(32)DMEM (.clk(clk_5KHz), .we(we_dm), .a(alu_out[5:0]), .d(wd_dm), .q(rd_dm));

parts.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ endmodule
9696

9797
module dmem #(parameter wide = 8)
9898
(input clk, we, [31:0] a, [wide-1:0] d, output [wide-1:0] q);
99-
reg [wide-1:0] ram [0:50];
99+
reg [wide-1:0] ram [0:500];
100100
//reg [wide-1:0] ram [0:91000];
101101
always @ (posedge clk) if (we & (a != 32'h0000_7000)) ram[a/4] <= d;
102102
assign q = ram[a/4];

uart/uart_top.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
`timescale 1ns/1ps
2-
module uart_top(input RClk, input clk, input reset, input we, input [31:0] dataIn, address, output serial);
2+
module uart_top(input RClk, input clk, input reset, input we, input [31:0] dataIn, address, output serial, Empty_out);
33

44
wire write = ((we == 1'b1) && (address == 32'h0000_7000)) ? 1:0;
55
wire [31:0] toUart;
66
wire busy;
7-
wire Empty_out;
7+
//wire Empty_out;
88
wire pNextWordToRead;
99
reg [2:0] counter;
1010
wire [7:0] data;
@@ -64,7 +64,7 @@ endmodule
6464

6565
module aFifo
6666
#(parameter DATA_WIDTH = 32,
67-
ADDRESS_WIDTH = 5,
67+
ADDRESS_WIDTH = 6,
6868
FIFO_DEPTH = (1 << ADDRESS_WIDTH))
6969
//Reading port
7070
(//output reg [DATA_WIDTH-1:0] Data_out,
@@ -169,7 +169,7 @@ endmodule
169169

170170

171171
module GrayCounter
172-
#(parameter COUNTER_WIDTH = 5)
172+
#(parameter COUNTER_WIDTH = 6)
173173

174174
(output reg [COUNTER_WIDTH-1:0] GrayCount_out, //'Gray' code count output.
175175

0 commit comments

Comments
 (0)