152 lines
6.1 KiB
Systemverilog
152 lines
6.1 KiB
Systemverilog
// Generated by CIRCT firtool-1.151.0
|
|
|
|
// Users can define 'PRINTF_COND' to add an extra gate to prints.
|
|
`ifndef PRINTF_COND_
|
|
`ifdef PRINTF_COND
|
|
`define PRINTF_COND_ (`PRINTF_COND)
|
|
`else // PRINTF_COND
|
|
`define PRINTF_COND_ 1
|
|
`endif // PRINTF_COND
|
|
`endif // not def PRINTF_COND_
|
|
module TLFragmenter_FPGAUART(
|
|
input clock,
|
|
reset,
|
|
output auto_anon_in_a_ready,
|
|
input auto_anon_in_a_valid,
|
|
input [2:0] auto_anon_in_a_bits_opcode,
|
|
auto_anon_in_a_bits_size,
|
|
input [1:0] auto_anon_in_a_bits_source,
|
|
input [28:0] auto_anon_in_a_bits_address,
|
|
input [7:0] auto_anon_in_a_bits_mask,
|
|
input [63:0] auto_anon_in_a_bits_data,
|
|
input auto_anon_in_d_ready,
|
|
output auto_anon_in_d_valid,
|
|
output [2:0] auto_anon_in_d_bits_opcode,
|
|
auto_anon_in_d_bits_size,
|
|
output [1:0] auto_anon_in_d_bits_source,
|
|
output [63:0] auto_anon_in_d_bits_data,
|
|
input auto_anon_out_a_ready,
|
|
output auto_anon_out_a_valid,
|
|
output [2:0] auto_anon_out_a_bits_opcode,
|
|
output [1:0] auto_anon_out_a_bits_size,
|
|
output [5:0] auto_anon_out_a_bits_source,
|
|
output [28:0] auto_anon_out_a_bits_address,
|
|
output [7:0] auto_anon_out_a_bits_mask,
|
|
output [63:0] auto_anon_out_a_bits_data,
|
|
output auto_anon_out_d_ready,
|
|
input auto_anon_out_d_valid,
|
|
input [2:0] auto_anon_out_d_bits_opcode,
|
|
input [1:0] auto_anon_out_d_bits_size,
|
|
input [5:0] auto_anon_out_d_bits_source,
|
|
input [63:0] auto_anon_out_d_bits_data
|
|
);
|
|
|
|
wire _repeater_io_full;
|
|
wire _repeater_io_deq_valid;
|
|
wire [2:0] _repeater_io_deq_bits_opcode;
|
|
wire [2:0] _repeater_io_deq_bits_size;
|
|
wire [1:0] _repeater_io_deq_bits_source;
|
|
wire [28:0] _repeater_io_deq_bits_address;
|
|
wire [7:0] _repeater_io_deq_bits_mask;
|
|
reg [2:0] acknum;
|
|
reg [2:0] dOrig;
|
|
reg dToggle;
|
|
wire dFirst = acknum == 3'h0;
|
|
wire [5:0] _dsizeOH1_T = 6'h7 << auto_anon_out_d_bits_size;
|
|
wire [2:0] _GEN = ~(auto_anon_out_d_bits_source[2:0]);
|
|
wire [2:0] dFirst_size_hi = auto_anon_out_d_bits_source[2:0] & {1'h1, _GEN[2:1]};
|
|
wire [2:0] _dFirst_size_T_8 =
|
|
{1'h0, dFirst_size_hi[2:1]} | ~(_dsizeOH1_T[2:0]) & {_GEN[0], _dsizeOH1_T[2:1]};
|
|
wire [2:0] dFirst_size =
|
|
{|dFirst_size_hi,
|
|
|(_dFirst_size_T_8[2:1]),
|
|
_dFirst_size_T_8[2] | _dFirst_size_T_8[0]};
|
|
wire drop =
|
|
~(auto_anon_out_d_bits_opcode[0]) & (|(auto_anon_out_d_bits_source[2:0]));
|
|
wire anonOut_d_ready = auto_anon_in_d_ready | drop;
|
|
wire [12:0] _aOrigOH1_T = 13'h3F << _repeater_io_deq_bits_size;
|
|
reg [2:0] gennum;
|
|
wire aFirst = gennum == 3'h0;
|
|
wire [2:0] aFragnum = aFirst ? ~(_aOrigOH1_T[5:3]) : gennum - 3'h1;
|
|
reg aToggle_r;
|
|
wire _GEN_0 = ~_repeater_io_full | _repeater_io_deq_bits_opcode[2];
|
|
wire _GEN_1 = ~_repeater_io_full | (&_repeater_io_deq_bits_mask);
|
|
`ifndef SYNTHESIS
|
|
always @(posedge clock) begin
|
|
if ((`PRINTF_COND_) & ~reset & ~_GEN_0)
|
|
$fwrite(32'h80000002,
|
|
"Assertion failed\n at Fragmenter.scala:321 assert (!repeater.io.full || !aHasData)\n");
|
|
if ((`PRINTF_COND_) & ~reset & ~_GEN_1)
|
|
$fwrite(32'h80000002,
|
|
"Assertion failed\n at Fragmenter.scala:324 assert (!repeater.io.full || in_a.bits.mask === fullMask)\n");
|
|
end // always @(posedge)
|
|
`endif // not def SYNTHESIS
|
|
always @(posedge clock) begin
|
|
automatic logic _GEN_2;
|
|
automatic logic _GEN_3;
|
|
_GEN_2 = anonOut_d_ready & auto_anon_out_d_valid;
|
|
_GEN_3 = _GEN_2 & dFirst;
|
|
if (~reset) begin
|
|
end
|
|
if (reset) begin
|
|
acknum <= 3'h0;
|
|
dToggle <= 1'h0;
|
|
gennum <= 3'h0;
|
|
end
|
|
else begin
|
|
if (_GEN_2)
|
|
acknum <=
|
|
dFirst
|
|
? auto_anon_out_d_bits_source[2:0]
|
|
: acknum
|
|
- {2'h0, auto_anon_out_d_bits_opcode[0] | (&auto_anon_out_d_bits_size)};
|
|
if (_GEN_3)
|
|
dToggle <= auto_anon_out_d_bits_source[3];
|
|
if (auto_anon_out_a_ready & _repeater_io_deq_valid)
|
|
gennum <= aFragnum;
|
|
end
|
|
if (_GEN_3)
|
|
dOrig <= dFirst_size;
|
|
if (aFirst)
|
|
aToggle_r <= dToggle;
|
|
end // always @(posedge)
|
|
Repeater_TLBundleA_a29d64s2k1z3u repeater (
|
|
.clock (clock),
|
|
.reset (reset),
|
|
.io_repeat (_repeater_io_deq_bits_opcode[2] & (|aFragnum)),
|
|
.io_full (_repeater_io_full),
|
|
.io_enq_ready (auto_anon_in_a_ready),
|
|
.io_enq_valid (auto_anon_in_a_valid),
|
|
.io_enq_bits_opcode (auto_anon_in_a_bits_opcode),
|
|
.io_enq_bits_size (auto_anon_in_a_bits_size),
|
|
.io_enq_bits_source (auto_anon_in_a_bits_source),
|
|
.io_enq_bits_address (auto_anon_in_a_bits_address),
|
|
.io_enq_bits_mask (auto_anon_in_a_bits_mask),
|
|
.io_deq_ready (auto_anon_out_a_ready),
|
|
.io_deq_valid (_repeater_io_deq_valid),
|
|
.io_deq_bits_opcode (_repeater_io_deq_bits_opcode),
|
|
.io_deq_bits_size (_repeater_io_deq_bits_size),
|
|
.io_deq_bits_source (_repeater_io_deq_bits_source),
|
|
.io_deq_bits_address (_repeater_io_deq_bits_address),
|
|
.io_deq_bits_mask (_repeater_io_deq_bits_mask)
|
|
);
|
|
assign auto_anon_in_d_valid = auto_anon_out_d_valid & ~drop;
|
|
assign auto_anon_in_d_bits_opcode = auto_anon_out_d_bits_opcode;
|
|
assign auto_anon_in_d_bits_size = dFirst ? dFirst_size : dOrig;
|
|
assign auto_anon_in_d_bits_source = auto_anon_out_d_bits_source[5:4];
|
|
assign auto_anon_in_d_bits_data = auto_anon_out_d_bits_data;
|
|
assign auto_anon_out_a_valid = _repeater_io_deq_valid;
|
|
assign auto_anon_out_a_bits_opcode = _repeater_io_deq_bits_opcode;
|
|
assign auto_anon_out_a_bits_size =
|
|
_repeater_io_deq_bits_size[2] ? 2'h3 : _repeater_io_deq_bits_size[1:0];
|
|
assign auto_anon_out_a_bits_source =
|
|
{_repeater_io_deq_bits_source, ~(aFirst ? dToggle : aToggle_r), aFragnum};
|
|
assign auto_anon_out_a_bits_address =
|
|
{_repeater_io_deq_bits_address[28:6],
|
|
_repeater_io_deq_bits_address[5:0] | {~(aFragnum | _aOrigOH1_T[5:3]), 3'h0}};
|
|
assign auto_anon_out_a_bits_mask = _repeater_io_full ? 8'hFF : auto_anon_in_a_bits_mask;
|
|
assign auto_anon_out_a_bits_data = auto_anon_in_a_bits_data;
|
|
assign auto_anon_out_d_ready = anonOut_d_ready;
|
|
endmodule
|
|
|