You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following design (within the Details) infers 2 DSP blocks: Info (21062): Implemented 2 DSP elements.
fromamaranthimport*fromamaranth.libimportwiringfromamaranth.lib.wiringimportIn, Outfromamaranth_boards.de10_nanoimportDE10NanoPlatformclassDSPMACBlock(wiring.Component):
# using signed 18x18->36 mode# https://www.intel.com/content/www/us/en/docs/programmable/683375/current/independent-multiplier-mode.htmlmul_a: In(signed(18)) # A input is 18 bitsmul_b: In(signed(18)) # B input is 18 bitsresult: Out(signed(36)) # result is len(A)+len(B)defelaborate(self, platform):
m=Module()
m.d.sync+=self.result.eq(self.mul_a*self.mul_b)
returnmclassTop(Elaboratable):
defelaborate(self, platform):
m=Module()
m.submodules.mac=mac=DSPMACBlock()
m.d.comb+= [
mac.mul_a.eq(Mux(platform.request("switch", 0).i, -1, 0)), # use all bitsmac.mul_b.eq(Mux(platform.request("switch", 1).i, -1, 0)),
platform.request("led", 0).o.eq(mac.result[-1])
]
returnmif__name__=="__main__":
DE10NanoPlatform().build(Top())
Given that this is a supported DSP mode, I would expect this to infer only 1 block. This worked properly with the old IR. If I make both operands of the * signed by modifying line 107 of the generated Verilog (assign \$1 = ...) then correctly 1 block is inferred.
Not sure if there's any difference in functionality between the two scenarios.
The following design (within the Details) infers 2 DSP blocks:
Info (21062): Implemented 2 DSP elements
.Given that this is a supported DSP mode, I would expect this to infer only 1 block. This worked properly with the old IR. If I make both operands of the
*
signed by modifying line 107 of the generated Verilog (assign \$1 = ...
) then correctly 1 block is inferred.Not sure if there's any difference in functionality between the two scenarios.
Versions:
The text was updated successfully, but these errors were encountered: