Browse Source

initial commit of cbcdes verilog verification sources

master
T. Meissner 12 years ago
parent
commit
b6fdf6bbd4
5 changed files with 1530 additions and 12 deletions
  1. +470
    -0
      cbcdes/sim/verilog/data_input.txt
  2. +470
    -0
      cbcdes/sim/verilog/data_output.txt
  3. +470
    -0
      cbcdes/sim/verilog/key_input.txt
  4. +11
    -11
      cbcdes/sim/verilog/tb_cbcdes.tcl
  5. +109
    -1
      cbcdes/sim/verilog/tb_cbcdes.v

+ 470
- 0
cbcdes/sim/verilog/data_input.txt View File

@ -0,0 +1,470 @@
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0100000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0001000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000010000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000100000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000001000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000010000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000100
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
0000000000000001
95F8A5E5DD31D900
DD7F121CA5015619
2E8653104F3834EA
4BD388FF6CD81D4F
20B9E767B2FB1456
55579380D77138EF
6CC5DEFAAF04512F
0D9F279BA5D87260
D9031B0271BD5A0A
424250B37C3DD951
B8061B7ECD9A21E5
F15D0F286B65BD28
ADD0CC8D6E5DEBA1
E6D5F82752AD63D1
ECBFE3BD3F591A5E
F356834379D165CD
2B9F982F20037FA9
889DE068A16F0BE6
E19E275D846A1298
329A8ED523D71AEC
E7FCE22557D23C97
12A9F5817FF2D65D
A484C3AD38DC9C19
FBE00A8A1EF8AD72
750D079407521363
64FEED9C724C2FAF
F02B263B328E2B60
9D64555A9A10B852
D106FF0BED5255D7
E1652C6B138C64A5
E428581186EC8F46
AEB5F5EDE22D1A36
E943D7568AEC0C5C
DF98C8276F54B04B
B160E4680F6C696F
FA0752B07D9C4AB8
CA3A2B036DBC8502
5E0905517BB59BCF
814EEB3B91D90726
4D49DB1532919C9F
25EB5FC3F8CF0621
AB6A20C0620D1C6F
79E90DBC98F92CCA
866ECEDD8072BB0E
8B54536F2F3E64A8
EA51D3975595B86B
CAFFC6AC4542DE31
8DD45A2DDF90796C
1029D55E880EC2D0
5D86CB23639DBEA9
1D1CA853AE7C0C5F
CE332329248F3228
8405D1ABE24FB942
E643D78090CA4207
48221B9937748A23
DD7C0BBD61FAFD54
2FBC291A570DB5C4
E07C30D7E4E26E12
0953E2258E8E90A1
5B711BC4CEEBF2EE
CC083F1E6D9E85F6
D2FD8867D50D2DFE
06E7EA22CE92708F
166B40B44ABA4BD6
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
01A1D6D039776742
5CD54CA83DEF57DA
0248D43806F67172
51454B582DDF440A
42FD443059577FA2
059B5E0851CF143A
0756D8E0774761D2
762514B829BF486A
3BDD119049372802
26955F6835AF609A
164D5E404F275232
6B056E18759F5CCA
004BD6EF09176062
480D39006EE762F2
437540C8698F3CFA
072D43A077075292
02FE55778117F12A
1D9D5C5018F728C2
305532286D6F295A
95F8A5E5DD31D900
DD7F121CA5015619
2E8653104F3834EA
4BD388FF6CD81D4F
20B9E767B2FB1456
55579380D77138EF
6CC5DEFAAF04512F
0D9F279BA5D87260
D9031B0271BD5A0A
424250B37C3DD951
B8061B7ECD9A21E5
F15D0F286B65BD28
ADD0CC8D6E5DEBA1
E6D5F82752AD63D1
ECBFE3BD3F591A5E
F356834379D165CD
2B9F982F20037FA9
889DE068A16F0BE6
E19E275D846A1298
329A8ED523D71AEC
E7FCE22557D23C97
12A9F5817FF2D65D
A484C3AD38DC9C19
FBE00A8A1EF8AD72
750D079407521363
64FEED9C724C2FAF
F02B263B328E2B60
9D64555A9A10B852
D106FF0BED5255D7
E1652C6B138C64A5
E428581186EC8F46
AEB5F5EDE22D1A36
E943D7568AEC0C5C
DF98C8276F54B04B
B160E4680F6C696F
FA0752B07D9C4AB8
CA3A2B036DBC8502
5E0905517BB59BCF
814EEB3B91D90726
4D49DB1532919C9F
25EB5FC3F8CF0621
AB6A20C0620D1C6F
79E90DBC98F92CCA
866ECEDD8072BB0E
8B54536F2F3E64A8
EA51D3975595B86B
CAFFC6AC4542DE31
8DD45A2DDF90796C
1029D55E880EC2D0
5D86CB23639DBEA9
1D1CA853AE7C0C5F
CE332329248F3228
8405D1ABE24FB942
E643D78090CA4207
48221B9937748A23
DD7C0BBD61FAFD54
2FBC291A570DB5C4
E07C30D7E4E26E12
0953E2258E8E90A1
5B711BC4CEEBF2EE
CC083F1E6D9E85F6
D2FD8867D50D2DFE
06E7EA22CE92708F
166B40B44ABA4BD6
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0100000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0001000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000010000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000100000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000001000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000010000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000100
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
0000000000000001
95A8D72813DAA94D
0EEC1487DD8C26D5
7AD16FFB79C45926
D3746294CA6A6CF3
809F5F873C1FD761
C02FAFFEC989D1FC
4615AA1D33E72F10
2055123350C00858
DF3B99D6577397C8
31FE17369B5288C9
DFDD3CC64DAE1642
178C83CE2B399D94
50F636324A9B7F80
A8468EE3BC18F06D
A2DC9E92FD3CDE92
CAC09F797D031287
90BA680B22AEB525
CE7A24F350E280B6
882BFF0AA01A0B87
25610288924511C2
C71516C29C75D170
5199C29A52C9F059
C22F0A294A71F29F
EE371483714C02EA
A81FBD448F9E522F
4F644C92E192DFED
1AFA9A66A6DF92AE
B3C1CC715CB879D8
19D032E64AB0BD8B
3CFAA7A7DC8720DC
B7265F7F447AC6F3
9DB73B3C0D163F54
8181B65BABF4A975
93C9B64042EAA240
5570530829705592
8638809E878787A0
41B9A79AF79AC208
7A9BE42F2009A892
29038D56BA6D2745
5495C6ABF1E5DF51
AE13DBD561488933
024D1FFA8904E389
D1399712F99BF02E
14C1D7C1CFFEC79E
1DE5279DAE3BED6F
E941A33F85501303
DA99DBBC9A03F379
B7FC92F91D8E92E9
AE8E5CAA3CA04E85
9CC62DF43B6EED74
D863DBB5C59A91A0
A1AB2190545B91D7
0875041E64C570F7
5A594528BEBEF1CC
FCDB3291DE21F0C0
869EFD7F9F265A09
88D55E54F54C97B4
0C0CC00C83EA48FD
83BC8EF3A6570183
DF725DCAD94EA2E9
E652B53B550BE8B0
AF527120C485CBB0
0F04CE393DB926D5
C9F00FFC74079067
7CFD82A593252B4E
CB49A2F9E91363E3
00B588BE70D23F56
406A9A6AB43399AE
6CB773611DCA9ADA
67FD21C17DBB5D70
9592CB4110430787
A6B7FF68A318DDD3
4D102196C914CA16
2DFA9F4573594965
B46604816C0E0774
6E7E6221A4F34E87
AA85E74643233199
2E5A19DB4D1962D6
23A866A809D30894
D812D961F017D320
055605816E58608F
ABD88E8B1B7716F1
537AC95BE69DA1E1
AED0F6AE3C25CDD8
B3E35A5EE53E7B8D
61C79C71921A2EF8
E2F5728F0995013C
1AEAC39A61F0A464
690F5B0D9A26939B
7A389D10354BD271
868EBB51CAB4599A
7178876E01F19B2A
AF37FB421F8C4095
86A560F10EC6D85B
0CD3DA020021DC09
EA676B2CB7DB2B7A
DFD64A815CAF1A0F
5C513C9C4886C088
0A2AEEAE3FF4AB77
EF1BF03E5DFA575A
88BF0DB6D70DEE56
A1F9915541020B56
6FBF1CAFCFFD0556
2F22E49BAB7CA1AC
5A6B612CC26CCE4A
5F4C038ED12B2E41
63FAC0D034D9F793

+ 470
- 0
cbcdes/sim/verilog/data_output.txt View File

@ -0,0 +1,470 @@
95F8A5E5DD31D900
DD7F121CA5015619
2E8653104F3834EA
4BD388FF6CD81D4F
20B9E767B2FB1456
55579380D77138EF
6CC5DEFAAF04512F
0D9F279BA5D87260
D9031B0271BD5A0A
424250B37C3DD951
B8061B7ECD9A21E5
F15D0F286B65BD28
ADD0CC8D6E5DEBA1
E6D5F82752AD63D1
ECBFE3BD3F591A5E
F356834379D165CD
2B9F982F20037FA9
889DE068A16F0BE6
E19E275D846A1298
329A8ED523D71AEC
E7FCE22557D23C97
12A9F5817FF2D65D
A484C3AD38DC9C19
FBE00A8A1EF8AD72
750D079407521363
64FEED9C724C2FAF
F02B263B328E2B60
9D64555A9A10B852
D106FF0BED5255D7
E1652C6B138C64A5
E428581186EC8F46
AEB5F5EDE22D1A36
E943D7568AEC0C5C
DF98C8276F54B04B
B160E4680F6C696F
FA0752B07D9C4AB8
CA3A2B036DBC8502
5E0905517BB59BCF
814EEB3B91D90726
4D49DB1532919C9F
25EB5FC3F8CF0621
AB6A20C0620D1C6F
79E90DBC98F92CCA
866ECEDD8072BB0E
8B54536F2F3E64A8
EA51D3975595B86B
CAFFC6AC4542DE31
8DD45A2DDF90796C
1029D55E880EC2D0
5D86CB23639DBEA9
1D1CA853AE7C0C5F
CE332329248F3228
8405D1ABE24FB942
E643D78090CA4207
48221B9937748A23
DD7C0BBD61FAFD54
2FBC291A570DB5C4
E07C30D7E4E26E12
0953E2258E8E90A1
5B711BC4CEEBF2EE
CC083F1E6D9E85F6
D2FD8867D50D2DFE
06E7EA22CE92708F
166B40B44ABA4BD6
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0100000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0001000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000010000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000100000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000001000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000010000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000100
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
0000000000000001
95A8D72813DAA94D
0EEC1487DD8C26D5
7AD16FFB79C45926
D3746294CA6A6CF3
809F5F873C1FD761
C02FAFFEC989D1FC
4615AA1D33E72F10
2055123350C00858
DF3B99D6577397C8
31FE17369B5288C9
DFDD3CC64DAE1642
178C83CE2B399D94
50F636324A9B7F80
A8468EE3BC18F06D
A2DC9E92FD3CDE92
CAC09F797D031287
90BA680B22AEB525
CE7A24F350E280B6
882BFF0AA01A0B87
25610288924511C2
C71516C29C75D170
5199C29A52C9F059
C22F0A294A71F29F
EE371483714C02EA
A81FBD448F9E522F
4F644C92E192DFED
1AFA9A66A6DF92AE
B3C1CC715CB879D8
19D032E64AB0BD8B
3CFAA7A7DC8720DC
B7265F7F447AC6F3
9DB73B3C0D163F54
8181B65BABF4A975
93C9B64042EAA240
5570530829705592
8638809E878787A0
41B9A79AF79AC208
7A9BE42F2009A892
29038D56BA6D2745
5495C6ABF1E5DF51
AE13DBD561488933
024D1FFA8904E389
D1399712F99BF02E
14C1D7C1CFFEC79E
1DE5279DAE3BED6F
E941A33F85501303
DA99DBBC9A03F379
B7FC92F91D8E92E9
AE8E5CAA3CA04E85
9CC62DF43B6EED74
D863DBB5C59A91A0
A1AB2190545B91D7
0875041E64C570F7
5A594528BEBEF1CC
FCDB3291DE21F0C0
869EFD7F9F265A09
88D55E54F54C97B4
0C0CC00C83EA48FD
83BC8EF3A6570183
DF725DCAD94EA2E9
E652B53B550BE8B0
AF527120C485CBB0
0F04CE393DB926D5
C9F00FFC74079067
7CFD82A593252B4E
CB49A2F9E91363E3
00B588BE70D23F56
406A9A6AB43399AE
6CB773611DCA9ADA
67FD21C17DBB5D70
9592CB4110430787
A6B7FF68A318DDD3
4D102196C914CA16
2DFA9F4573594965
B46604816C0E0774
6E7E6221A4F34E87
AA85E74643233199
2E5A19DB4D1962D6
23A866A809D30894
D812D961F017D320
055605816E58608F
ABD88E8B1B7716F1
537AC95BE69DA1E1
AED0F6AE3C25CDD8
B3E35A5EE53E7B8D
61C79C71921A2EF8
E2F5728F0995013C
1AEAC39A61F0A464
690F5B0D9A26939B
7A389D10354BD271
868EBB51CAB4599A
7178876E01F19B2A
AF37FB421F8C4095
86A560F10EC6D85B
0CD3DA020021DC09
EA676B2CB7DB2B7A
DFD64A815CAF1A0F
5C513C9C4886C088
0A2AEEAE3FF4AB77
EF1BF03E5DFA575A
88BF0DB6D70DEE56
A1F9915541020B56
6FBF1CAFCFFD0556
2F22E49BAB7CA1AC
5A6B612CC26CCE4A
5F4C038ED12B2E41
63FAC0D034D9F793
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0100000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0001000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000010000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000100000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000001000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000010000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000100
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
0000000000000001
95F8A5E5DD31D900
DD7F121CA5015619
2E8653104F3834EA
4BD388FF6CD81D4F
20B9E767B2FB1456
55579380D77138EF
6CC5DEFAAF04512F
0D9F279BA5D87260
D9031B0271BD5A0A
424250B37C3DD951
B8061B7ECD9A21E5
F15D0F286B65BD28
ADD0CC8D6E5DEBA1
E6D5F82752AD63D1
ECBFE3BD3F591A5E
F356834379D165CD
2B9F982F20037FA9
889DE068A16F0BE6
E19E275D846A1298
329A8ED523D71AEC
E7FCE22557D23C97
12A9F5817FF2D65D
A484C3AD38DC9C19
FBE00A8A1EF8AD72
750D079407521363
64FEED9C724C2FAF
F02B263B328E2B60
9D64555A9A10B852
D106FF0BED5255D7
E1652C6B138C64A5
E428581186EC8F46
AEB5F5EDE22D1A36
E943D7568AEC0C5C
DF98C8276F54B04B
B160E4680F6C696F
FA0752B07D9C4AB8
CA3A2B036DBC8502
5E0905517BB59BCF
814EEB3B91D90726
4D49DB1532919C9F
25EB5FC3F8CF0621
AB6A20C0620D1C6F
79E90DBC98F92CCA
866ECEDD8072BB0E
8B54536F2F3E64A8
EA51D3975595B86B
CAFFC6AC4542DE31
8DD45A2DDF90796C
1029D55E880EC2D0
5D86CB23639DBEA9
1D1CA853AE7C0C5F
CE332329248F3228
8405D1ABE24FB942
E643D78090CA4207
48221B9937748A23
DD7C0BBD61FAFD54
2FBC291A570DB5C4
E07C30D7E4E26E12
0953E2258E8E90A1
5B711BC4CEEBF2EE
CC083F1E6D9E85F6
D2FD8867D50D2DFE
06E7EA22CE92708F
166B40B44ABA4BD6
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
01A1D6D039776742
5CD54CA83DEF57DA
0248D43806F67172
51454B582DDF440A
42FD443059577FA2
059B5E0851CF143A
0756D8E0774761D2
762514B829BF486A
3BDD119049372802
26955F6835AF609A
164D5E404F275232
6B056E18759F5CCA
004BD6EF09176062
480D39006EE762F2
437540C8698F3CFA
072D43A077075292
02FE55778117F12A
1D9D5C5018F728C2
305532286D6F295A

+ 470
- 0
cbcdes/sim/verilog/key_input.txt View File

@ -0,0 +1,470 @@
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
1046913489980131
1007103489988020
10071034C8980120
1046103489988020
1086911519190101
1086911519580101
5107B01519580101
1007B01519190101
3107915498080101
3107919498080101
10079115B9080140
3107911598080140
1007D01589980101
9107911589980101
9107D01589190101
1007D01598980120
1007940498190101
0107910491190401
0107910491190101
0107940491190401
19079210981A0101
1007911998190801
10079119981A0801
1007921098190101
100791159819010B
1004801598190101
1004801598190102
1004801598190108
1002911598100104
1002911598190104
1002911598100201
1002911698100101
7CA110454A1A6E57
0131D9619DC1376E
07A1133E4A0B2686
3849674C2602319E
04B915BA43FEB5B6
0113B970FD34F2CE
0170F175468FB5E6
43297FAD38E373FE
07A7137045DA2A16
04689104C2FD3B2F
37D06BB516CB7546
1F08260D1AC2465E
584023641ABA6176
025816164629B007
49793EBC79B3258F
4FB05E1515AB73A7
49E95D6D4CA229BF
018310DC409B26D6
1C587F1C13924FEF
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
0101010101010101
8000000000000000
4000000000000000
2000000000000000
1000000000000000
0800000000000000
0400000000000000
0200000000000000
0080000000000000
0040000000000000
0020000000000000
0010000000000000
0008000000000000
0004000000000000
0002000000000000
0000800000000000
0000400000000000
0000200000000000
0000100000000000
0000080000000000
0000040000000000
0000020000000000
0000008000000000
0000004000000000
0000002000000000
0000001000000000
0000000800000000
0000000400000000
0000000200000000
0000000080000000
0000000040000000
0000000020000000
0000000010000000
0000000008000000
0000000004000000
0000000002000000
0000000000800000
0000000000400000
0000000000200000
0000000000100000
0000000000080000
0000000000040000
0000000000020000
0000000000008000
0000000000004000
0000000000002000
0000000000001000
0000000000000800
0000000000000400
0000000000000200
0000000000000080
0000000000000040
0000000000000020
0000000000000010
0000000000000008
0000000000000004
0000000000000002
1046913489980131
1007103489988020
10071034C8980120
1046103489988020
1086911519190101
1086911519580101
5107B01519580101
1007B01519190101
3107915498080101
3107919498080101
10079115B9080140
3107911598080140
1007D01589980101
9107911589980101
9107D01589190101
1007D01598980120
1007940498190101
0107910491190401
0107910491190101
0107940491190401
19079210981A0101
1007911998190801
10079119981A0801
1007921098190101
100791159819010B
1004801598190101
1004801598190102
1004801598190108
1002911598100104
1002911598190104
1002911598100201
1002911698100101
7CA110454A1A6E57
0131D9619DC1376E
07A1133E4A0B2686
3849674C2602319E
04B915BA43FEB5B6
0113B970FD34F2CE
0170F175468FB5E6
43297FAD38E373FE
07A7137045DA2A16
04689104C2FD3B2F
37D06BB516CB7546
1F08260D1AC2465E
584023641ABA6176
025816164629B007
49793EBC79B3258F
4FB05E1515AB73A7
49E95D6D4CA229BF
018310DC409B26D6
1C587F1C13924FEF

+ 11
- 11
cbcdes/sim/verilog/tb_cbcdes.tcl View File

@ -1,13 +1,13 @@
set signals [list] set signals [list]
lappend signals "tb_cdes.reset"
lappend signals "tb_cdes.clk"
lappend signals "tb_cdes.start"
lappend signals "tb_cdes.validin"
lappend signals "tb_cdes.mode"
lappend signals "tb_cdes.key"
lappend signals "tb_cdes.iv"
lappend signals "tb_cdes.datain"
lappend signals "tb_cdes.readyout"
lappend signals "tb_cdes.validout"
lappend signals "tb_cdes.dataout"
lappend signals "tb_cbcdes.reset"
lappend signals "tb_cbcdes.clk"
lappend signals "tb_cbcdes.start"
lappend signals "tb_cbcdes.validin"
lappend signals "tb_cbcdes.mode"
lappend signals "tb_cbcdes.key"
lappend signals "tb_cbcdes.iv"
lappend signals "tb_cbcdes.datain"
lappend signals "tb_cbcdes.readyout"
lappend signals "tb_cbcdes.validout"
lappend signals "tb_cbcdes.dataout"
set num_added [ gtkwave::addSignalsFromList $signals ] set num_added [ gtkwave::addSignalsFromList $signals ]

+ 109
- 1
cbcdes/sim/verilog/tb_cbcdes.v View File

@ -18,8 +18,8 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// ====================================================================== // ======================================================================
`timescale 1ns/1ps
`timescale 1ns/1ps
module tb_cbcdes; module tb_cbcdes;
@ -44,6 +44,23 @@ module tb_cbcdes;
wire validout; wire validout;
wire readyout; wire readyout;
integer index;
integer outdex;
integer enc_errors;
integer dec_errors;
reg [0:63] data_input [0:469];
reg [0:63] key_input [0:469];
reg [0:63] data_output [0:469];
// read in test data files
initial begin
$readmemh("data_input.txt", data_input);
$readmemh("key_input.txt", key_input);
$readmemh("data_output.txt", data_output);
end
// setup simulation // setup simulation
initial begin initial begin
@ -57,6 +74,97 @@ module tb_cbcdes;
always #5 clk = !clk; always #5 clk = !clk;
// stimuli generator process
initial
forever @(negedge reset) begin
@(posedge clk)
for (index = 0; index < 235; index = index + 1)
begin
@(posedge clk)
mode <= 0;
validin <= 1;
datain <= data_input[index];
key <= key_input[index];
end
for (index = 0; index < 10; index = index + 1)
begin
@(posedge clk)
validin <= 0;
end
for (index = 235; index < 470; index = index + 1)
begin
@(posedge clk)
mode <= 1;
validin <= 1;
datain <= data_input[index];
key <= key_input[index];
end
@(posedge clk)
validin <= 0;
mode <= 0;
end
// checker process
always begin : checker
wait (reset)
// encryption tests
@(posedge validout)
for(outdex = 0; outdex < 235; outdex = outdex + 1)
begin
@(posedge clk)
// detected an error -> print error message
// increment error counter
if (dataout != data_output[outdex]) begin
$display ("error, output was %h - should have been %h", dataout, data_output[outdex]);
enc_errors = enc_errors + 1;
end
end
// simulation finished -> print messages and if an error was detected
$display ("#############");
if (enc_errors) begin
$display ("encryption tests finished, %0d errors detected :(", enc_errors);
end else begin
$display ("encryption tests finished, no errors detected :)");
end
// decryption tests
@(posedge validout)
for(outdex = 235; outdex < 470; outdex = outdex + 1)
begin
@(posedge clk)
// detected an error -> print error message
// increment error counter
if (dataout != data_output[outdex]) begin
$display ("error, output was %h - should have been %h", dataout, data_output[outdex]);
dec_errors = dec_errors + 1;
end
end
// simulation finished -> print messages and if an error was detected
$display ("#############");
if (dec_errors) begin
$display ("decryption tests finished, %0d errors detected :(", dec_errors);
end else begin
$display ("decryption tests finished, no errors detected :)");
end
$display ("#############");
if (dec_errors | enc_errors) begin
$display ("simulation finished, %0d errors detected :(", enc_errors + dec_errors);
end else begin
$display ("simulation tests finished, no errors detected :)");
end
$display ("#############");
@(posedge clk)
$finish;
end
// dut // dut
cbcdes i_cbcdes ( cbcdes i_cbcdes (
.reset_i(reset), .reset_i(reset),


Loading…
Cancel
Save