From 6e8e124cce82c83abf4273d7362c6eaa62d2d426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Sat, 15 Mar 2014 08:30:55 +0100 Subject: (1) Updated interface to new std. (2) Added missing input designation in tasks. Now simumaltion with ModelSim works. --- src/tb/tb_sha256.v | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'src/tb/tb_sha256.v') diff --git a/src/tb/tb_sha256.v b/src/tb/tb_sha256.v index eaee522..69f2186 100644 --- a/src/tb/tb_sha256.v +++ b/src/tb/tb_sha256.v @@ -7,6 +7,7 @@ // // Author: Joachim Strombergson // Copyright (c) 2014, SUNET +// All rights reserved. // // Redistribution and use in source and binary forms, with or // without modification, are permitted provided that the following @@ -103,10 +104,10 @@ module tb_sha256(); reg tb_clk; reg tb_reset_n; reg tb_cs; - reg tb_write_read; + reg tb_we; reg [7 : 0] tb_address; - reg [31 : 0] tb_data_in; - wire [31 : 0] tb_data_out; + reg [31 : 0] tb_write_data; + wire [31 : 0] tb_read_data; wire tb_error; reg [31 : 0] read_data; @@ -121,12 +122,12 @@ module tb_sha256(); .reset_n(tb_reset_n), .cs(tb_cs), - .write_read(tb_write_read), + .we(tb_we), .address(tb_address), - .data_in(tb_data_in), - .data_out(tb_data_out), + .write_data(tb_write_data), + .read_data(tb_read_data), .error(tb_error) ); @@ -165,12 +166,12 @@ module tb_sha256(); $display("State of DUT"); $display("------------"); $display("Inputs and outputs:"); - $display("cs = 0x%01x, write_read = 0x%01x", - dut.cs, dut.write_read); + $display("cs = 0x%01x, we = 0x%01x", + dut.cs, dut.we); $display("address = 0x%02x", dut.address); - $display("data_in = 0x%08x, data_out = 0x%08x", - dut.data_in, dut.data_out); - $display("tmp_data_out = 0x%08x", dut.tmp_data_out); + $display("write_data = 0x%08x, read_data = 0x%08x", + dut.write_data, dut.read_data); + $display("tmp_read_data = 0x%08x", dut.tmp_read_data); $display(""); $display("Control and status:"); @@ -229,9 +230,9 @@ module tb_sha256(); tb_clk = 0; tb_reset_n = 0; tb_cs = 0; - tb_write_read = 0; + tb_we = 0; tb_address = 6'h00; - tb_data_in = 32'h00000000; + tb_write_data = 32'h00000000; end endtask // init_dut @@ -293,12 +294,12 @@ module tb_sha256(); end tb_address = address; - tb_data_in = word; + tb_write_data = word; tb_cs = 1; - tb_write_read = 1; + tb_we = 1; #(2 * CLK_HALF_PERIOD); tb_cs = 0; - tb_write_read = 0; + tb_we = 0; end endtask // write_word @@ -341,9 +342,9 @@ module tb_sha256(); begin tb_address = address; tb_cs = 1; - tb_write_read = 0; + tb_we = 0; #(2 * CLK_HALF_PERIOD); - read_data = tb_data_out; + read_data = tb_read_data; tb_cs = 0; if (DEBUG) @@ -416,8 +417,8 @@ module tb_sha256(); // // Perform test of a single block digest. //---------------------------------------------------------------- - task single_block_test([511 : 0] block, - [255 : 0] expected); + task single_block_test(input [511 : 0] block, + input [255 : 0] expected); begin $display("*** TC%01d - Single block test started.", tc_ctr); @@ -451,10 +452,10 @@ module tb_sha256(); // Perform test of a double block digest. Note that we check // the digests for both the first and final block. //---------------------------------------------------------------- - task double_block_test([511 : 0] block0, - [255 : 0] expected0, - [511 : 0] block1, - [255 : 0] expected1 + task double_block_test(input [511 : 0] block0, + input [255 : 0] expected0, + input [511 : 0] block1, + input [255 : 0] expected1 ); begin $display("*** TC%01d - Double block test started.", tc_ctr); -- cgit v1.2.3