text stringlengths 0 207k |
|---|
reg startofpacket_reg; |
reg endofpacket_reg; |
reg [OUT_SEGMENT_W-1:0] mask; |
reg [RESPONSE_STATUS_W-1:0] response_status_reg; |
reg [ADDRESS_W-1:0] int_output_sel; |
reg [clogb2(RATIO)-1:0] output_sel; |
reg [OUT_SEGMENT_W-1:0] data_array [0:RATIO-1]; |
reg [OUT_NUMSYMBOLS-1:0] byteen_array [0:RATIO-1]; |
// In narrow-to-wide adaptation, each input datum/byteenable bit maps to |
// one of OUT_NUMSYMBOLS/IN_NUMSYMBOLS subfields in the wider output |
// packet. (Call these subfields "segments".) A subfield of the input |
// address, in_bitforselect, selects the segment. Examples: |
// 8-16 adaptation: in_bitforselect = in_address_field[0] |
// 8-32 adaptation: in_bitforselect = in_address_field[1:0] |
// 8-64 adaptation: in_bitforselect = in_address_field[2:0] |
// 16-32 adaptation: in_bitforselect = in_address_field[1] |
// 32-64 adaptation: in_bitforselect = in_address_field[2] |
// The width of in_bitforselect is |
// log2(OUT_NUM_SYMBOLS) - log2(IN_NUM_SYMBOLS) = |
// log2(RATIO) |
// The msb of in_bitforselect is driven by |
// in_adress_field[log2(OUT_NUMSYMBOLS) - 1] |
// The lsb of in_adress_field is driven by |
// in_adress_field[log2(IN_NUMSYMBOLS)] |
reg [clogb2(RATIO)-1:0] in_bitforselect; |
integer i, j; |
// ---------------------------------------- |
// Input Field Mapping |
// ---------------------------------------- |
reg [ADDRESS_W-1:0] address_for_adaptation; |
always @* begin |
in_size_field = in_data[IN_PKT_BURST_SIZE_H :IN_PKT_BURST_SIZE_L ]; |
in_data_field = in_data[IN_PKT_DATA_H :IN_PKT_DATA_L ]; |
in_byteen_field = in_data[IN_PKT_BYTEEN_H :IN_PKT_BYTEEN_L ]; |
address_from_packet = in_data[IN_PKT_ADDR_H :IN_PKT_ADDR_L ]; |
//in_address_field = in_data[IN_PKT_ADDR_H :IN_PKT_ADDR_L ]; |
in_byte_cnt_field = in_data[IN_PKT_BYTE_CNT_H :IN_PKT_BYTE_CNT_L ]; |
in_cmpr_read = in_data[IN_PKT_TRANS_COMPRESSED_READ]; |
in_lock_field = in_data[IN_PKT_TRANS_EXCLUSIVE]; |
in_burst_type_field = in_data[IN_PKT_BURST_TYPE_H :IN_PKT_BURST_TYPE_L ]; |
in_response_status_field = in_data[IN_PKT_RESPONSE_STATUS_H :IN_PKT_RESPONSE_STATUS_L]; |
end |
// ---------------------------------------- |
// Process unaligned address for first address of the burst |
// ---------------------------------------- |
generate |
if (IN_NUMSYMBOLS > OUT_NUMSYMBOLS && ENABLE_ADDRESS_ALIGNMENT) begin |
reg [ADDRESS_W + (BWRAP_W-1) + BURST_SIZE_W + BURST_TYPE_W - 1 :0] address_for_alignment; |
reg [ADDRESS_W + clogb2(IN_NUMSYMBOLS)-1:0] address_after_aligned; |
assign address_for_alignment = {address_from_packet, in_size_field}; |
assign address_for_adaptation = address_after_aligned[ADDRESS_W-1:0]; |
altera_merlin_address_alignment |
#( |
.ADDR_W (ADDRESS_W), |
.BURSTWRAP_W (BWRAP_W), |
.INCREMENT_ADDRESS (0), |
.NUMSYMBOLS (IN_NUMSYMBOLS), |
.SIZE_W (BURST_SIZE_W) |
) check_and_align_address_to_size |
( |
.clk(clk), |
.reset(reset), |
.in_data(address_for_alignment), |
.out_data(address_after_aligned), |
.in_valid(), |
.in_sop(), |
.in_eop(), |
.out_ready() |
); |
end else begin |
assign address_for_adaptation = address_from_packet; |
end |
endgenerate |
generate begin |
if (FIRST_EXISTS) begin |
always @* begin |
in_first_field = in_data[IN_FIRST_H:IN_FIRST_L]; |
end |
end else begin |
always @* begin |
in_first_field = '0; |
end |
end |
if (MID_EXISTS) begin |
always @* begin |
in_mid_field = in_data[IN_MID_H:IN_MID_L]; |
end |
end else begin |
always @* begin |
in_mid_field = '0; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.