ibex icon indicating copy to clipboard operation
ibex copied to clipboard

Missing prim_clock_gating module

Open darbaria opened this issue 7 years ago • 10 comments

I can't seem to find this module anywhere. Can someone point me to where this might be?

darbaria avatar Jun 06 '19 18:06 darbaria

You can find it in hw/ip/prim/abstract. It then picks either the RTL or xilinx version underneath.

On Thu, Jun 6, 2019 at 11:49 AM Ashish Darbari [email protected] wrote:

I can't seem to find this module anywhere. Can someone point me to where this might be?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lowRISC/ibex/issues/68?email_source=notifications&email_token=AAH2RSTNOQDCJZTWLL2JVWLPZFL2BA5CNFSM4HVHGS7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYDBWGA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2RSQTONXXNSCXXZQ3NU3PZFL2BANCNFSM4HVHGS7A .

tjaychen avatar Jun 06 '19 18:06 tjaychen

where exactly is hw/ip/prim/ folder?

darbaria avatar Jun 06 '19 19:06 darbaria

You can create it yourself as:

module prim_clock_gating
  (
    input  logic clk_i,
    input  logic en_i,
    input  logic test_en_i,
    output logic clk_o
  );

`ifdef FPGA_SYNTHESIS
  assign clk_o = clk_i;
`else
  logic clk_en;

  always_latch
  begin
     if (clk_i == 1'b0)
       clk_en <= en_i | test_en_i;
  end

  assign clk_o = clk_i & clk_en;
`endif


endmodule

ikarageo avatar Jun 06 '19 19:06 ikarageo

Thanks, @ikarageo. Oh! I didn't realize that. I do have a legacy cluster_clock_gating module from 0riscy. BTW is it worth leaving a template .v inside the rtl folder so at least that checkout compiles with at least formal tools. I recall from 0riscy checkout I'd the same problem back then.

@tjaychen I'd still be interested to know where is the hw/ip folder?

darbaria avatar Jun 06 '19 19:06 darbaria

Oops sorry, I'm pretty new to this, it seems like I may have been talking about the wrong thing. Sorry about that.

On Thu, Jun 6, 2019 at 12:41 PM Ashish Darbari [email protected] wrote:

Thanks, @ikarageo https://github.com/ikarageo. Oh! I didn't realize that. I do have a legacy cluster_clock_gating module from 0riscy. BTW is it worth leaving a template .v inside the rtl folder so at least that checkout compiles with at least formal tools. I recall from 0riscy checkout I'd the same problem back then.

@tjaychen https://github.com/tjaychen I'd still be interested to know where is the hw/ip folder?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/ibex/issues/68?email_source=notifications&email_token=AAH2RSWAWL5IZYBCW5IFAV3PZFR7XA5CNFSM4HVHGS7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXD6FGY#issuecomment-499638939, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2RSVD275CXMWLOECT44DPZFR7XANCNFSM4HVHGS7A .

tjaychen avatar Jun 06 '19 20:06 tjaychen

But there should be one in dv/uvm/tb/prim_clock_gating.sv right?

towoe avatar Jun 06 '19 20:06 towoe

There is one there indeed! Should it be there?

darbaria avatar Jun 06 '19 21:06 darbaria

I added "dv/uvm/tb/prim_clock_gating.sv" just to get the TB compile and running. I agree we should have some default implementation like this so that user can check out the repo and get it up and running without adding an additional module.

taoliug avatar Jun 07 '19 07:06 taoliug

prim_clock_gating should be supplied by the user from his/her technology library, as documented here: https://ibex-core.readthedocs.io/en/latest/register_file.html#latch-based-register-file

I'll keep this bug around to explore what we can do to support a sample/default implementation.

imphil avatar Jun 07 '19 08:06 imphil

This requirement is now more clearly documented in https://ibex-core.readthedocs.io/en/latest/getting_started.html.

imphil avatar Jun 26 '19 13:06 imphil