Skip to content

Commit

Permalink
use acknowledgement signal instead of valid & ready combinational logic
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-ishitani committed Oct 27, 2018
1 parent 7748ffa commit a0d22fc
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
12 changes: 10 additions & 2 deletions env/bfm/tnoc_bfm_flit_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,48 @@ interface tnoc_bfm_flit_if (
bit ready;
tnoc_bfm_flit flit;
bit vc_available;
bit acknowledgement;

assign acknowledgement = (valid && ready) ? '1 : '0;

clocking master_cb @(posedge clk);
output valid;
input ready;
output flit;
input vc_available;
input acknowledgement;
endclocking

clocking slave_cb @(posedge clk);
input valid;
output ready;
input flit;
output vc_available;
input acknowledgement;
endclocking

clocking monitor_cb @(posedge clk);
input valid;
input ready;
input flit;
input vc_available;
input acknowledgement;
endclocking

modport initiator(
output valid,
input ready,
output flit,
input vc_available
input vc_available,
input acknowledgement
);

modport target(
input valid,
output ready,
input flit,
output vc_available
output vc_available,
input acknowledgement
);
endinterface
`endif
2 changes: 1 addition & 1 deletion env/bfm/tnoc_bfm_packet_vc_driver.svh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class tnoc_bfm_packet_vc_driver extends tnoc_bfm_component_base #(
do_reset();
end
else begin
if (vif.monitor_cb.valid && vif.monitor_cb.ready) begin
if (vif.monitor_cb.acknowledgement) begin
finish_flit();
end

Expand Down
2 changes: 1 addition & 1 deletion env/bfm/tnoc_bfm_packet_vc_monitor.svh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class tnoc_bfm_packet_vc_monitor extends tnoc_bfm_component_base #(
flit_item = sample_flit_item();
end

if (!(vif.monitor_cb.valid && vif.monitor_cb.ready)) begin
if (!vif.monitor_cb.acknowledgement) begin
continue;
end

Expand Down
2 changes: 1 addition & 1 deletion rtl/common/tnoc_flit_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface tnoc_flit_if
localparam int FLIT_INDEX = (is_local_port(PORT_TYPE)) ? i : 0;
tnoc_common_header header = '0;
always @* begin
if (valid[i] && ready[i] && is_header_flit(flit[FLIT_INDEX])) begin
if (acknowledgement[i] && is_header_flit(flit[FLIT_INDEX])) begin
header = get_common_header(flit[FLIT_INDEX]);
end
end
Expand Down
8 changes: 2 additions & 6 deletions rtl/common/tnoc_flit_if_arbiter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ module tnoc_flit_if_arbiter

for (genvar j = 0;j < ENTRIES;++j) begin : g
localparam int IF_INDEX = ENTRIES*i+j;
assign request[j] = (
(flit_in[IF_INDEX].valid != '0) && is_header_flit(flit_in[IF_INDEX].flit[0])
) ? '1 : '0;
assign free[j] = (
(flit_in[IF_INDEX].acknowledgement != '0) && is_tail_flit(flit_in[IF_INDEX].flit[0])
) ? '1 : '0;
assign request[j] = ((flit_in[IF_INDEX].valid != '0) && is_head_flit(flit_in[IF_INDEX].flit[0])) ? '1 : '0;
assign free[j] = ((flit_in[IF_INDEX].acknowledgement != '0) && is_tail_flit(flit_in[IF_INDEX].flit[0])) ? '1 : '0;
end

tbcm_round_robin_arbiter #(
Expand Down
2 changes: 1 addition & 1 deletion rtl/common/tnoc_flit_if_fifo.sv
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module tnoc_flit_if_fifo
assign push = |flit_in_if.valid;
assign push_data.valid = flit_in_if.valid;
assign push_data.flit = flit_in_if.flit[0];
assign pop = |(flit_out_if.valid & flit_out_if.ready);
assign pop = |flit_out_if.acknowledgement;

tbcm_fifo #(
.DATA_TYPE (s_fifo_data ),
Expand Down
8 changes: 6 additions & 2 deletions rtl/common/tnoc_vc_selector.sv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module tnoc_vc_selector
tnoc_flit_if.target flit_in_if,
tnoc_flit_if.initiator flit_out_if
);
`include "tnoc_packet.svh"
`include "tnoc_flit.svh"
`include "tnoc_flit_utils.svh"

localparam int CHANNELS = CONFIG.virtual_channels;

tnoc_flit_if #(CONFIG, 1) flit_fifo_in_if[CHANNELS]();
Expand Down Expand Up @@ -43,8 +47,8 @@ module tnoc_vc_selector
logic [CHANNELS-1:0] vc_free;

for (genvar i = 0;i < CHANNELS;++i) begin
assign vc_request[i] = flit_fifo_out_if[i].valid;
assign vc_free[i] = (flit_fifo_out_if[i].flit[0].tail) ? flit_fifo_out_if[i].valid & flit_fifo_out_if[i].ready : '0;
assign vc_request[i] = (flit_fifo_out_if[i].valid && is_head_flit(flit_fifo_out_if[i].flit[0])) ? '1 : '0;
assign vc_free[i] = (flit_fifo_out_if[i].acknowledgement && is_tail_flit(flit_fifo_out_if[i].flit[0])) ? '1 : '0;
end

tbcm_round_robin_arbiter #(
Expand Down
10 changes: 3 additions & 7 deletions rtl/router/tnoc_error_checker.sv
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@ module tnoc_error_checker
logic start_of_error_request;
logic end_of_error_request;

assign start_of_error_request = (
start_of_packet && invalid_destination
) ? '1 : '0;
assign end_of_error_request = (
flit_demux_out_if[1].valid && flit_demux_out_if[1].ready && is_tail_flit(flit_demux_out_if[1].flit[0])
) ? '1 : '0;
assign start_of_error_request = (start_of_packet && invalid_destination) ? '1 : '0;
assign end_of_error_request = (flit_demux_out_if[1].acknowledgement && is_tail_flit(flit_demux_out_if[1].flit[0])) ? '1 : '0;
always_ff @(posedge clk, negedge rst_n) begin
if (!rst_n) begin
error_route_busy[0] <= '0;
Expand All @@ -138,7 +134,7 @@ module tnoc_error_checker
start_of_packet && invalid_destination && is_non_posted_request_packet_type(common_header.packet_type)
) ? '1 : '0;
assign end_of_error_response = (
flit_mux_in_if[1].valid && flit_mux_in_if[1].ready && is_tail_flit(flit_mux_in_if[1].flit[0])
flit_mux_in_if[1].acknowledgement && is_tail_flit(flit_mux_in_if[1].flit[0])
) ? '1 : '0;
always_ff @(posedge clk, negedge rst_n) begin
if (!rst_n) begin
Expand Down
8 changes: 2 additions & 6 deletions rtl/router/tnoc_route_selector.sv
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,8 @@ module tnoc_route_selector
e_route route_next;
e_route route_latched;

assign start_of_packet = (
flit_in_if[i].valid && is_head_flit(flit_in_if[i].flit[0])
) ? '1 : '0;
assign end_of_packet = (
flit_in_if[i].valid && flit_in_if[i].ready && is_tail_flit(flit_in_if[i].flit[0])
) ? '1 : '0;
assign start_of_packet = (flit_in_if[i].valid && is_head_flit(flit_in_if[i].flit[0])) ? '1 : '0;
assign end_of_packet = (flit_in_if[i].acknowledgement && is_tail_flit(flit_in_if[i].flit[0])) ? '1 : '0;

assign route = (start_of_packet) ? route_next : route_latched;
assign route_next = select_route(flit_in_if[i].flit[0], i_id_x, i_id_y);
Expand Down

0 comments on commit a0d22fc

Please sign in to comment.