nmigen-learning/fpga/common.dg

14 lines
320 B
Plaintext

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