|
楼主 |
发表于 2021-9-29 10:39:05
|
显示全部楼层
两者生成的verilog逻辑代码都一样,只是变量名不同而已,因为是个简单逻辑代码,我copy了一个的verilog代码如下:
module MultiOuts(
input clock,
input reset,
output io_in_ready,
input io_in_valid,
input [7:0] io_in_bits,
input io_outs_0_ready,
output io_outs_0_valid,
output [7:0] io_outs_0_bits,
input io_outs_1_ready,
output io_outs_1_valid,
output [7:0] io_outs_1_bits,
input io_outs_2_ready,
output io_outs_2_valid,
output [7:0] io_outs_2_bits,
input io_outs_3_ready,
output io_outs_3_valid,
output [7:0] io_outs_3_bits
);
reg [7:0] cnt; // @[MultiOuts.scala 17:20]
reg [31:0] _RAND_0;
wire [7:0] _T_1 = cnt + 8'h1; // @[MultiOuts.scala 18:14]
wire _T_6 = 8'h4 == cnt; // @[Conditional.scala 37:30]
wire [7:0] _T_8 = io_in_bits + 8'h1; // @[MultiOuts.scala 32:30]
wire _T_15 = 8'h8 == cnt; // @[Conditional.scala 37:30]
wire [7:0] _T_17 = io_in_bits + 8'h2; // @[MultiOuts.scala 39:30]
wire _GEN_12 = _T_15 & io_outs_0_ready; // @[Conditional.scala 39:67]
wire _GEN_14 = _T_15 & io_outs_1_ready; // @[Conditional.scala 39:67]
wire _GEN_16 = _T_15 & io_outs_2_ready; // @[Conditional.scala 39:67]
wire _GEN_18 = _T_15 & io_outs_3_ready; // @[Conditional.scala 39:67]
assign io_in_ready = 1'h0; // @[Decoupled.scala 72:20]
assign io_outs_0_valid = _T_6 ? io_outs_0_ready : _GEN_12; // @[Decoupled.scala 56:20 Decoupled.scala 47:20 Decoupled.scala 47:20]
assign io_outs_0_bits = _T_6 ? _T_8 : _T_17; // @[MultiOuts.scala 24:14 Decoupled.scala 48:19 Decoupled.scala 48:19]
assign io_outs_1_valid = _T_6 ? io_outs_1_ready : _GEN_14; // @[Decoupled.scala 56:20 Decoupled.scala 47:20 Decoupled.scala 47:20]
assign io_outs_1_bits = _T_6 ? _T_8 : _T_17; // @[MultiOuts.scala 24:14 Decoupled.scala 48:19 Decoupled.scala 48:19]
assign io_outs_2_valid = _T_6 ? io_outs_2_ready : _GEN_16; // @[Decoupled.scala 56:20 Decoupled.scala 47:20 Decoupled.scala 47:20]
assign io_outs_2_bits = _T_6 ? _T_8 : _T_17; // @[MultiOuts.scala 24:14 Decoupled.scala 48:19 Decoupled.scala 48:19]
assign io_outs_3_valid = _T_6 ? io_outs_3_ready : _GEN_18; // @[Decoupled.scala 56:20 Decoupled.scala 47:20 Decoupled.scala 47:20]
assign io_outs_3_bits = _T_6 ? _T_8 : _T_17; // @[MultiOuts.scala 24:14 Decoupled.scala 48:19 Decoupled.scala 48:19]
`ifdef RANDOMIZE_GARBAGE_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_INVALID_ASSIGN
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_REG_INIT
`define RANDOMIZE
`endif
`ifdef RANDOMIZE_MEM_INIT
`define RANDOMIZE
`endif
`ifndef RANDOM
`define RANDOM $random
`endif
`ifdef RANDOMIZE_MEM_INIT
integer initvar;
`endif
`ifndef SYNTHESIS
initial begin
`ifdef RANDOMIZE
`ifdef INIT_RANDOM
`INIT_RANDOM
`endif
`ifndef VERILATOR
`ifdef RANDOMIZE_DELAY
#`RANDOMIZE_DELAY begin end
`else
#0.002 begin end
`endif
`endif
`ifdef RANDOMIZE_REG_INIT
_RAND_0 = {1{`RANDOM}};
cnt = _RAND_0[7:0];
`endif // RANDOMIZE_REG_INIT
`endif // RANDOMIZE
end // initial
`endif // SYNTHESIS
always @(posedge clock) begin
if (reset) begin
cnt <= 8'h0;
end else begin
cnt <= _T_1;
end
end
endmodule
|
|