Skip to content

Commit eac6b9f

Browse files
committed
RFC #66: Update according to feedback
1 parent dbb347f commit eac6b9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

text/0066-simulation-time.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ To convert it back to a number, the following properties are available:
4343
- `.picoseconds -> fractions.Fraction`
4444
- `.femtoseconds -> int`
4545

46+
To calculate the reciprocal frequency, the following properties are available:
47+
- `.hertz -> fractions.Fraction`
48+
- `.kilohertz -> fractions.Fraction`
49+
- `.megahertz -> fractions.Fraction`
50+
- `.gigahertz -> fractions.Fraction`
51+
- Accessing these properties when the period is zero will raise `ZeroDivisionError`.
52+
4653
The following operators are defined:
4754
- `.__lt__(other: Period) -> bool`
4855
- `.__le__(other: Period) -> bool`
@@ -67,7 +74,7 @@ The following operators are defined:
6774
- Operators involving `numbers.Real` operands have the result rounded back to the closest integer femtosecond representation.
6875
- Operators given unsupported operand combinations will return `NotImplemented`.
6976

70-
`Simulator` and `SimulatorContext` both have a `.time() -> Period` method added that returns the elapsed time since start of simulation.
77+
`SimulatorContext` have an `.elapsed_time() -> Period` method added that returns the elapsed time since start of simulation.
7178

7279
These methods that has a `period` argument currently taking seconds as a `float` are updated to take a `Period`:
7380
- `Simulator.add_clock()`
@@ -111,6 +118,8 @@ Consequently, `Platform.default_clk_frequency()` is also deprecated and replaced
111118
Potentially useful to calculate the phase offset between a timestamp and a clock period.
112119
- Reflected operators that only accept `Period` operands are redundant and omitted.
113120

121+
- `.elapsed_time()` is only available from within a testbench/process, where it is well defined.
122+
114123
## Prior art
115124
[prior-art]: #prior-art
116125

0 commit comments

Comments
 (0)