Skip to content

Commit 42f1a1e

Browse files
committed
[core] Add the "period" field, docs to ClockDomain
Add a "period" field to the ClockDomain. Note: the fields of this domain (or any upstream domain) are highly experimental and may change at any time. Additionally, add some documentation about what a ClockDomain is. Signed-off-by: Schuyler Eldridge <[email protected]>
1 parent 74f04bf commit 42f1a1e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/src/main/scala/chisel3/domains/ClockDomain.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ package chisel3.domains
55
import chisel3.domain.{Domain, Field}
66
import chisel3.experimental.UnlocatableSourceInfo
77

8+
/** A Clock Domain
9+
*
10+
* This represents a collection of signals that toggle together. This does not
11+
* necessarily mean that signals associated with this domain share a clock or
12+
* will toggle in a predictable way. I.e., this domain can be used to describe
13+
* asynchronous signals or static signals (like strap pins).
14+
*/
815
object ClockDomain extends Domain()(sourceInfo = UnlocatableSourceInfo) {
916

1017
override def fields: Seq[(String, Field.Type)] = Seq(
11-
"name" -> Field.String
18+
"name" -> Field.String,
19+
"period" -> Field.Integer
1220
)
1321

1422
}

src/test/scala-2/chiselTests/DomainSpec.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class DomainSpec extends AnyFlatSpec with Matchers with FileCheck {
4343
"""|CHECK: circuit Foo :
4444
|CHECK: domain ClockDomain :
4545
|CHECK-NEXT: name : String
46+
|CHECK-NEXT: period : Integer
4647
|
4748
|CHECK: domain PowerDomain :
4849
|CHECK-NEXT: name : String

0 commit comments

Comments
 (0)