File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ module StreamingSHA256Test();
70
70
71
71
logic [7 : 0 ] state = 0 ;
72
72
logic [7 : 0 ] count = 0 ;
73
+ logic [7 : 0 ] count2 = 0 ;
73
74
74
75
always_ff @ (posedge clk) begin
75
76
@@ -321,7 +322,60 @@ module StreamingSHA256Test();
321
322
if (hash_valid) begin
322
323
if (hash == 256'h1581baebc5f9dcfd89c658b3c3303203fc0e2f93e3f9e0b593d8b2b8112c6eda ) begin
323
324
$display (" PASS" );
325
+
326
+ // "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" ->
327
+ // b6ac3cc10386331c765f04f041c147d0f278f2aed8eaa021e2d0057fc6f6ff9e
328
+ // 2x full block of content, then third block with padding+length
329
+ $display (" Hash 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA':" );
330
+ start <= 1 ;
324
331
state <= 21 ;
332
+ count <= 0 ;
333
+ end
334
+ else begin
335
+ $display (" FAIL" );
336
+ $finish ;
337
+ end
338
+ end
339
+ end
340
+
341
+ 21 : begin
342
+ update <= 1 ;
343
+ data_in <= " AAAA" ;
344
+ bytes_valid <= 4 ;
345
+ count <= count + 1 ;
346
+
347
+ if (count == 13 ) begin
348
+ state <= 22 ;
349
+ count2 <= 0 ;
350
+ end
351
+ end
352
+
353
+ 22 : begin
354
+ count2 <= count2 + 1 ;
355
+ if (count2 == 50 )
356
+ state <= 23 ;
357
+ end
358
+
359
+ 23 : begin
360
+ update <= 1 ;
361
+ data_in <= " AAAA" ;
362
+ bytes_valid <= 4 ;
363
+ count <= count + 1 ;
364
+
365
+ if (count == 31 )
366
+ state <= 24 ;
367
+ end
368
+
369
+ 24 : begin
370
+ finalize <= 1 ;
371
+ state <= 25 ;
372
+ end
373
+
374
+ 25 : begin
375
+ if (hash_valid) begin
376
+ if (hash == 256'hb6ac3cc10386331c765f04f041c147d0f278f2aed8eaa021e2d0057fc6f6ff9e ) begin
377
+ $display (" PASS" );
378
+ $finish ;
325
379
end
326
380
else begin
327
381
$display (" FAIL" );
You can’t perform that action at this time.
0 commit comments