`timescale 1ns / 1ps module test; reg [63:0] state; reg [79:0] keys; wire [63:0] res; wire clk; // Instantiate a module with a clock and res signal PRESENT inst ( .clk(clk), .res(res) ); initial begin state = 64'h0000000000000000; keys = 80'h00000000000000000000; clk = 0; end always #10 clk = ~clk; initial begin #600 $finish(); end endmodule请在模块中添加相应的输入端口声明
时间: 2023-06-23 16:09:50 浏览: 82
timescale 1ns / 1ps
module test(
input [79:0] keys,
input clk,
output reg [63:0] state,
output wire [63:0] res
);
// Instantiate a module with a clock and res signal
PRESENT inst (
.clk(clk),
.res(res)
);
always @ (posedge clk) begin
// Your code here
end
endmodule
相关问题
`timescale 1ns / 1ps module test; reg [63:0] state; reg [79:0] keys; wire [63:0] res; wire clk; // Instantiate a module with a clock and res signal PRESENT inst ( .clk(clk), .res(res) ); initial begin state = 64'h0000000000000000; keys = 80'h00000000000000000000; clk = 0; end always #10 clk = ~clk; initial begin #600 $finish(); end endmodule这段代码的错误是什么
这段代码的错误是在实例化 PRESENT 模块时没有传入 state 和 keys 信号。应该在 PRESENT 模块的端口连接列表中添加对应的信号连接。如下所示:
```
PRESENT inst (
.clk(clk),
.state(state),
.keys(keys),
.res(res)
);
```
阅读全文