lekernel changed the topic of #m-labs to: Mixxeo, Migen, MiSoC & other M-Labs projects :: fka #milkymist :: Logs http://irclog.whitequark.org/m-labs
elaforest has quit [Ping timeout: 250 seconds]
bentley`` has quit [Ping timeout: 255 seconds]
bentley` has joined #m-labs
<nengel> When instantiating 3rd-party verilog modules in migen, how do I put constants of a specific bit-width on inputs?
<ysionneau> you could declare a Signal(N) for instance which would be "N bits wide"
<ysionneau> and you can use that Signal as an input of the instanciation
<ysionneau> for an example of verilog instanciation from Migen : https://github.com/m-labs/misoc/blob/master/misoclib/lm32/__init__.py
<ysionneau> look at how it creates the self.interrupt Signal(32) and how it is passed to the lm32 instance
<ysionneau> it seems there is also this kind of syntax : https://github.com/m-labs/misoc/blob/master/misoclib/minimac3/__init__.py#L48
<ysionneau> I don't know which one is the preferred one
<ysionneau> and if your signal is constant, just put comb += yoursignal.eq(constante value)
<nengel> thanks. I assume the PreformattedParam only works for parameters (as they can be strings)?
nicksydney_ has joined #m-labs
nicksydney has quit [Ping timeout: 244 seconds]
nicksydney has joined #m-labs
nicksydney_ has quit [Ping timeout: 244 seconds]
aeris has quit [*.net *.split]
aeris has joined #m-labs
<sb0> nengel, PreformattedParam is only required when you want to override the normal way Migen prints out constants
<sb0> here it's used to make sure the value of the p_eba_reset parameter is always 32-bit wide (because values other bit widths tickle bugs in the lm32 verilog)
<sb0> otherwise, migen would use the minimum number of bits required to represend eba_reset
<sb0> if your verilog design doesn't have such bugs, you should not need PreformattedParam
<nengel> yes, that is the exact problem I was having
<sb0> better use "wire [expected bit width] _parameter = parameter;" somewhere in the verilog
<nengel> it's a parameter (generic), not a wire
<sb0> then parameter is automatically zero- or sign-extended
<nengel> and I'm not writing the verilog
<sb0> yes but you can make it a wire before using it
<nengel> no because I don't use it
<sb0> but in some cases (like lm32) it's messy, which is why there's PreformattedParam
<sb0> which is also messy, but less
<nengel> I give a parameter to an instance, which copies that parameter to a sub-instance, which accesses a bitrange of the parameter.
<nengel> which gives an error if it's not at least 9 bit wide.
<sb0> yes. that's a common problem. you can assign it to a 9-bit wire in the sub-instance, and slice that.
<nengel> I'm not touching the sub-instance
<nengel> I'm not touching the instance
<nengel> not my circus, not my monkeys
xiangfu has joined #m-labs
_florent_ has joined #m-labs
FabM has quit [Quit: ChatZilla 0.9.90.1 [Iceweasel 24.8.1/20140924224142]]
elaforest has joined #m-labs
xiangfu has quit [Remote host closed the connection]
FabM has joined #m-labs
FabM has quit [Quit: ChatZilla 0.9.91 [Iceweasel 31.1.0/20140903072827]]
FabM has joined #m-labs
elaforest has quit [Ping timeout: 272 seconds]
kyak has quit []
kyak has joined #m-labs
cfelton has quit [Remote host closed the connection]
mithro has quit [Remote host closed the connection]
mithro has joined #m-labs
cfelton has joined #m-labs
elaforest has joined #m-labs
_florent_ has quit [Ping timeout: 258 seconds]
_florent_ has joined #m-labs
elaforest has quit [Ping timeout: 250 seconds]