whitequark
b227352258
hdl.ast: cast Mux() selector to bool if it is not a 1-bit value.
...
Fixes #232 .
2019-09-23 13:39:31 +00:00
whitequark
649444449d
hdl.ast: make Signal(name=) a keyword-only argument.
...
Almost no code would specify Signal(_, name) as a positional argument
on purpose, but forgetting parens and accidentally placing signedness
into the name position is so common that we had a test for it.
2019-09-23 11:08:43 +00:00
whitequark
378e924280
hdl.ast: rename nbits
to width
.
...
Also, replace `bits, sign = x.shape()` with more idiomatic
`width, signed = x.shape()`.
This unifies all properties corresponding to `len(x)` to `x.width`.
(Not all values have a `width` property.)
Fixes #210 .
2019-09-20 15:36:25 +00:00
whitequark
4777a7b3a2
hdl.{ast,dsl}: add Signal.enum; coerce Enum to Value; accept Enum patterns.
...
Fixes #207 .
2019-09-16 19:22:12 +00:00
whitequark
e8f79c5539
hdl.ast: add Value.matches(), accepting same language as Case().
...
Fixes #202 .
2019-09-14 21:06:12 +00:00
whitequark
32310aecad
hdl.ast: add Value.xor, mapping to $reduce_xor.
...
Fixes #147 .
2019-09-13 14:29:46 +00:00
whitequark
b23a9794a4
hdl.ast: add Value.{any,all}, mapping to $reduce_{or,and}.
...
Refs #147 .
2019-09-13 13:14:52 +00:00
whitequark
7342662bee
hdl.ast: warn if reset value is truncated.
...
Fixes #183 .
2019-09-10 07:26:34 +00:00
whitequark
9b398b502e
hdl.ast: check type of Sample(domain=...).
...
Fixes #199 .
2019-09-08 23:55:05 +00:00
whitequark
ccfbccc044
hdl.ast: add Signal.range(...), to replace Signal(min=..., max=...).
...
Fixes #196 .
2019-09-08 12:10:31 +00:00
whitequark
ed7e07c6c1
hdl.ast: implement Initial.
...
This is the last remaining part for first-class formal support.
2019-08-15 02:53:07 +00:00
whitequark
94e13effad
hdl.ast: deprecate Value.part, add Value.{bit,word}_select.
...
Fixes #148 .
2019-08-03 13:07:06 +00:00
whitequark
a7fbff94d8
hdl.{ast,cd,dsl,xfrm}: reject inappropriately used comb domain.
...
Fixes #125 .
2019-07-08 10:26:49 +00:00
whitequark
0ab215e5ed
hdl.ast: recognize a Enum used as decoder and format it better.
2019-07-02 19:34:44 +00:00
whitequark
e52b15d236
hdl.ast: add name_suffix=".." option to Signal.like().
...
This simplifies creation of related signals with nice names during
metaprogramming, e.g.
def make_ff(m, sig):
sig_ff = Signal.like(sig, name_suffix="_ff")
m.d.sync += sig_ff.eq(sig)
return sig_ff
2019-06-12 22:26:57 +00:00
whitequark
ad1a40c934
hdl.ast: implement values with custom lowering.
2019-06-11 07:01:44 +00:00
whitequark
51c03ca391
hdl.xfrm: handle empty lhs in LHSGroup{Analyzer,Filter}.
2019-06-04 10:26:01 +00:00
whitequark
360bc9b5b4
hdl.ast: improve tests for exceptional conditions.
2019-04-21 07:20:00 +00:00
whitequark
33f9bd2a1d
hdl.ast: accept Signals with identical min/max bounds.
...
And produce a 0-bit signal.
Fixes #58 .
2019-04-21 07:16:59 +00:00
whitequark
a74cacdc69
hdl.ast: handle a common typo, such as Signal(1, True).
2019-04-03 14:59:01 +00:00
whitequark
f71e0fffbb
hdl.ast: fix shape calculation for *.
...
This was carried over from Migen, and is wrong there too.
Counterexample: 1'sd-1 * 4'sd-4 = 4'sd-4 (but should be 5'sd4).
2019-01-26 00:56:40 +00:00
whitequark
fa8e876356
hdl.ast: allow sampling ClockSignal, ResetSignal.
2019-01-17 05:23:06 +00:00
whitequark
b3de114d67
hdl.ast: add Sample.
2019-01-17 01:36:27 +00:00
whitequark
cb2f18ee37
hdl.ast: fix naming of Signal.like() signals when tracer fails.
2019-01-16 17:20:38 +00:00
whitequark
dbbcc49a71
hdl.ast: Cat.{operands→parts}
2018-12-18 19:15:50 +00:00
whitequark
80c5343600
hdl.ast: implement Array and ArrayProxy.
2018-12-15 17:16:31 +00:00
whitequark
c6e7a93717
hdl: appropriately rename tests. NFC.
2018-12-15 16:13:53 +00:00