Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlackBox clock + reset #22

Closed
Dolu1990 opened this issue Apr 21, 2014 · 3 comments
Closed

BlackBox clock + reset #22

Dolu1990 opened this issue Apr 21, 2014 · 3 comments

Comments

@Dolu1990
Copy link

Hi,

These time, i had a lot of fun with chisel, realy. But there are 1 point that blocking me, and that's not demonstrated in chisel-tutorial :

How create a BlackBox chisel code where a instance could be like that =>

  MyBlackBox bb_Instance_forClockA(.clk(clockA),.reset(resetA),
       ...
  );
  MyBlackBox bb_Instance_forClockB(.clk(clockB),.reset(resetB),
       ...
  );

As you can see, any instance of the blackbox have the same IO name, event if they don't have same clock source.

In addition, i think show the method to do blackbox with parameter (setVerilogParameters(s".myParam($myParam)") could be great.

This example could be very usefull : D

@Dolu1990
Copy link
Author

After consulltation of source code, that's not possible to do that ".clk(clockA)"
because in verilog.scala :

def emitDef(c: Module): String = {
    ...
    if (c.clocks.length > 0) {
      res = res + (c.clocks).map(x => "." + emitRef(x) + "(" + emitRef(x) + ")").reduceLeft(_ + ", " + _)
    }

Somebody know if there is a plan for fix that ? if no, i can try to fix that with a pull request in the chisel repository.

@ben-k
Copy link
Member

ben-k commented Apr 24, 2014

It seems like you're asking about support for multiple clock domains, which are now supported in Chisel. See Section 18 of the most recent Chisel manual.

I think the reset signal is global, though. You may want to post this comment as a feature request in the main Chisel repo (ucb-bar/chisel) if you want a more thorough response.

@Dolu1990
Copy link
Author

Hi,
Thanks for answer : D

Multiple clock domaine is not well supported for black boxing because when you do multiple instance of a black box with different clock, that don't call the same verilog module : .clockA(clockA) in place of .blackBoxClockName(clockA)

For example now chisel do that :

  MyBlackBox_0 instA(.clockA(clockA), ... 
  );
  MyBlackBox_1 instB(.clockB(clockB), ... 
  );

That made 2 different verilog implementation of the same BlackBox juste because clock name change.

Reset was not realy my ask, but do a global reset in a multiple clock domaine design,where reset go directly to each flip flip is a bad idea. (Bad boot with setup and hold violation)

When i have post this issue, it was for new tutorial about that, but after that i realise that is a not supported feactures of chisel. With this consideration, it's true, this issue must move in chisel repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants