question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can assign registers from different clock domain

See original GitHub issue

It’s possible to assign a register in a different clock domain than the one it was created in, but the assignment still happens on the register instantiation clock. For example:

val a = Reg(...)
withClock (someDifferentClock) {
  a := somethingElse
}

But a still updates on the enclosing clock, not someDifferentClock.

The register assignment in a different clock domain should probably be an error, as the results are not what would be expected from reading the code.

Type of issue: other enhancement

Impact: API modification

Development Phase: proposal

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aswatermancommented, Nov 30, 2018

Please don’t change this - we rely upon it extensively. The documentation and scaladoc should just be very clear that the register gets its clock at declaration time, not at assignment time.

0reactions
ducky64commented, Dec 15, 2018

Resolution from the dev meeting today was “working as intended”.

There is also a proposed feature to check unsafe clock domain crossings in FIRRTL (with safe crossings as an annotation), though it not really the same issue (since reconstructing lexical scope information like withClock scopes in FIRRTL is iffy at best).

Read more comments on GitHub >

github_iconTop Results From Across the Web

register read/write from/to different clock domains
Hello, what is the best approach to read/write register from different clock domains. Lets say i have an ip with an axi-lite interface...
Read more >
Automatic Handling of Register Clock Domain Crossings
Control and status registers (CSRs) are one part of many designs where asynchronous clocks are often used and metastability is a very real ......
Read more >
Register Transformations with Multiple Clock Domains*
a wide range of register transformations relating to the multiple clock domains. For example, we can perform pipelining, phase abstraction, and retiming ...
Read more >
How to change reg in two different always blocks?
It's not possible to drive one output from two always blocks, and it's especially not possible to drive one output from two different...
Read more >
Transferring Data between Clock Domains Using Registers - NI
Before completing this task, verify that registers are the best data storage and transfer option for your application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found