top of page

[Chisel] Dequeuing data from Queue is delayed by one cycle


Phenomenon

The below is my design

  1. The ID stage puts the decoded instruction into the Queue

  2. EX stage retrieves the instruction from the Queue and executes it


At the first time, one cycle is required between putting the first command in the Queue with 1 and taking it out with 2.

The EX stage is always empty at first, so I want to take it out as soon as ID stage puts into the queue.



Cause

This is a Queue specification; if there is no instruction, deq.valid becomes false and it cannot be retrieved.

Since "instruction is put" is reflected from the next cycle, it seems that one extra cycle is required.

  io.deq.valid := !empty


Solution

The solution is to set flow = true in the Queue constructor argument (it is false by default).

If flow is true, valid is set to true


  if (flow) {
    when(io.enq.valid) { io.deq.valid := true.B }
  }


Reference

Recent Posts

See All

[chisel/scala] Create an array of Modules

What I want to do I have a class (parts) that I created and that inherits from Module. I want to place multiple instances (components) of this class in a circuit. What I tried I tried to create an arr

Let's do our best with our partner:​ ChatReminder

iphone6.5p2.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Let's do our best with our partner:​ ChatReminder

納品:iPhone6.5①.png

It is an application that achieves goals in a chat format with partners.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png

Theme diary: Decide the theme and record for each genre

It is a diary application that allows you to post and record with themes and sub-themes for each genre.

google-play-badge.png
Download_on_the_App_Store_Badge_JP_RGB_blk_100317.png
bottom of page