Commit the missing commons

This commit is contained in:
Peder Bergebakken Sundt 2020-08-15 15:50:36 +02:00
parent 0d02304dcf
commit 283b8ca081
1 changed files with 13 additions and 0 deletions

13
fpga/common.dg Normal file
View File

@ -0,0 +1,13 @@
import "/nmigen_dg/*"
# result = pipeline 5
# bind (+) 1
# bind (-) 5
pipeline = data *: funcs -> data where
for func in funcs =>
data = func data
# cast to signed, extending the signal by one bit
to_signed = signal -> out where
out = Signal$ signed (signal.width + 1)
Comb$ out :== signal