fixed snoop forwarder dequue to support out of order responses

This commit is contained in:
Blaise Tine 2020-05-23 20:19:54 -04:00
parent 9398c07afb
commit c54fa50715
4 changed files with 3637 additions and 98765 deletions

View file

@ -12,13 +12,13 @@ DBG_PRINT_FLAGS = -DDBG_PRINT_CORE_ICACHE \
-DDBG_PRINT_DRAM \
-DDBG_PRINT_OPAE
DBG_PRINT=$(DBG_PRINT_FLAGS)
#DBG_PRINT=$(DBG_PRINT_FLAGS)
#MULTICORE += -DNUM_CLUSTERS=2 -DNUM_CORES=4
#MULTICORE += -DNUM_CLUSTERS=1 -DNUM_CORES=4
#MULTICORE += -DNUM_CLUSTERS=1 -DNUM_CORES=2
DEBUG = 1
#DEBUG = 1
CFLAGS += -fPIC
@ -45,10 +45,10 @@ VL_FLAGS += -DGLOBAL_BLOCK_SIZE=64
# Debugigng
ifdef DEBUG
VL_FLAGS += --trace $(DBG_PRINT)
CFLAGS += -DVCD_OUTPUT
VL_FLAGS += --trace -DVCD_OUTPUT $(DBG_PRINT)
CFLAGS += -DVCD_OUTPUT $(DBG_PRINT)
else
CFLAGS += -DNDEBUG $(DBG_PRINT)
CFLAGS += -DNDEBUG
VL_FLAGS += -DNDEBUG
endif

File diff suppressed because it is too large Load diff

View file

@ -38,7 +38,7 @@ module VX_snp_forwarder #(
reg [`LOG2UP(SNRQ_SIZE)-1:0] rd_ptr, wr_ptr;
reg [`LOG2UP(SNRQ_SIZE)-1:0] pending_size;
reg [`REQS_BITS-1:0] fwdin_sel;
wire enqueue, dequeue;
wire enqueue, dequeue, empty;
wire fwdout_ready;
@ -67,8 +67,9 @@ module VX_snp_forwarder #(
assign snp_rsp_valid = fwdin_taken && (1 == pending_cntrs[fwdin_tag]); // send response
assign {snp_rsp_addr, snp_rsp_tag} = pending_reqs[fwdin_tag];
assign empty = (wr_ptr == rd_ptr);
assign enqueue = snp_req_valid && snp_req_ready;
assign dequeue = snp_rsp_valid && (rd_ptr == fwdin_tag);
assign dequeue = !empty && (0 == pending_cntrs[rd_ptr]);
always @(posedge clk) begin
if (reset) begin

View file

@ -195,14 +195,18 @@ void Simulator::flush_caches(uint32_t mem_addr, uint32_t size) {
if (vortex_->snp_rsp_valid) {
assert(pending_snp_reqs > 0);
--pending_snp_reqs;
//std::cout << timestamp << ": [sim] snp rsp: tag=" << vortex_->snp_rsp_tag << " pending=" << pending_snp_reqs << std::endl;
#ifdef DBG_PRINT_CACHE_SNP
std::cout << timestamp << ": [sim] snp rsp: tag=" << vortex_->snp_rsp_tag << " pending=" << pending_snp_reqs << std::endl;
#endif
}
if (vortex_->snp_req_valid && vortex_->snp_req_ready) {
if (vortex_->snp_req_addr < aligned_addr_end) {
vortex_->snp_req_addr += 1;
vortex_->snp_req_tag += 1;
++pending_snp_reqs;
//std::cout << timestamp << ": [sim] snp req: addr=" << vortex_->snp_req_addr << " tag=" << vortex_->snp_req_tag << " remain=" << (aligned_addr_end - vortex_->snp_req_addr) << std::endl;
#ifdef DBG_PRINT_CACHE_SNP
std::cout << timestamp << ": [sim] snp req: addr=" << vortex_->snp_req_addr << " tag=" << vortex_->snp_req_tag << " remain=" << (aligned_addr_end - vortex_->snp_req_addr) << std::endl;
#endif
} else {
vortex_->snp_req_valid = 0;
}