[Libre-soc-bugs] [Bug 835] add support for smtlib2 floating-point to yosys and nmigen

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Jun 1 06:27:34 BST 2022


https://bugs.libre-soc.org/show_bug.cgi?id=835

--- Comment #26 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #20)
> imho it should be in nmigen. the api may be changed to integrate more
> closely with nmigen's AST -- e.g. SmtBitVec can be converted directly to a
> nmigen Value, and the rtlil backend will insert the $smtlib2_expr instances,
> rather than having the user have to do that manually via m.submodules.
> 
> e.g.
> 
> m.d.comb += Assert(bitvec.to_value() != 23)

I changed the API so SmtBitVec and SmtBool are both ValueCastable, so you can
do things like:

sort = SmtSortFloat32()
neg_zero = SmtFloatingPoint.neg_zero(sort=sort)
m.d.comb += Assert(fp1.same(neg_zero)) # same() returns a SmtBool, which is
then cast to a Value by Assert.__init__

I also merged the CI additions into the smtlib2-expr-support branch and
adjusted .gitlab-ci.yml to use our yosys 0.13 fork with the $smtlib2_expr
support.

CI for yosys master fails because $smtlib2_expr isn't yet merged.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list