whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
revolve has joined #nmigen
<_whitenotifier-4> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/Jmxyl
<_whitenotifier-4> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/Jmxyl
<_whitenotifier-4> [YoWASP/nextpnr] whitequark f076e35 - Update dependencies.
<_whitenotifier-4> [YoWASP/nextpnr] whitequark f076e35 - Update dependencies.
emeb has quit [Quit: Leaving.]
emeb has quit [Quit: Leaving.]
mwk has joined #nmigen
mwk has quit [Changing host]
mwk has joined #nmigen
mwk has quit [Changing host]
lf has quit [Ping timeout: 240 seconds]
lf has quit [Ping timeout: 240 seconds]
lf has joined #nmigen
lf has joined #nmigen
<_whitenotifier-4> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JmxQF
<_whitenotifier-4> [YoWASP/yosys] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JmxQF
<_whitenotifier-4> [YoWASP/yosys] whitequark acf4de9 - Update dependencies.
<_whitenotifier-4> [YoWASP/yosys] whitequark acf4de9 - Update dependencies.
Raito_Bezarius has quit [Remote host closed the connection]
Raito_Bezarius has quit [Remote host closed the connection]
Raito_Bezarius has joined #nmigen
Raito_Bezarius has joined #nmigen
Degi_ has joined #nmigen
Degi_ has joined #nmigen
Degi has quit [Ping timeout: 276 seconds]
Degi has quit [Ping timeout: 276 seconds]
Degi_ is now known as Degi
Degi_ is now known as Degi
<d1b2> <4o> oh. ok. i thought python with creates local namespace
<d1b2> <4o> oh. ok. i thought python with creates local namespace
<d1b2> <4o> thanks
<d1b2> <4o> thanks
PyroPeter_ has joined #nmigen
PyroPeter_ has joined #nmigen
PyroPeter has quit [Ping timeout: 256 seconds]
PyroPeter_ is now known as PyroPeter
PyroPeter_ is now known as PyroPeter
Bertl is now known as Bertl_zZ
Bertl is now known as Bertl_zZ
_whitelogger_ has quit [Remote host closed the connection]
_whitelogger_ has joined #nmigen
_whitelogger_ has joined #nmigen
revolve has quit [Ping timeout: 246 seconds]
revolve has quit [Ping timeout: 246 seconds]
revolve has joined #nmigen
revolve has joined #nmigen
tpw_rules has quit [Quit: byeeee]
tpw_rules has quit [Quit: byeeee]
tpw_rules has joined #nmigen
tpw_rules has joined #nmigen
emeb_mac has quit [Quit: Leaving.]
emeb_mac has quit [Quit: Leaving.]
jeanthom has joined #nmigen
jeanthom has joined #nmigen
chipmuenk has joined #nmigen
chipmuenk has joined #nmigen
Bertl_zZ is now known as Bertl
Bertl_zZ is now known as Bertl
Raito_Bezarius has quit [Ping timeout: 260 seconds]
Raito_Bezarius has quit [Ping timeout: 260 seconds]
phire has quit [*.net *.split]
phire has quit [*.net *.split]
phire has joined #nmigen
phire has joined #nmigen
revolve has quit [Read error: Connection reset by peer]
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
revolve has joined #nmigen
GenTooMan has quit [Ping timeout: 240 seconds]
GenTooMan has quit [Ping timeout: 240 seconds]
GenTooMan has joined #nmigen
GenTooMan has joined #nmigen
vmedea[m] has quit [Ping timeout: 265 seconds]
vmedea[m] has quit [Ping timeout: 265 seconds]
duck2 has quit [Quit: Ping timeout (120 seconds)]
duck2 has quit [Quit: Ping timeout (120 seconds)]
duck2 has joined #nmigen
duck2 has joined #nmigen
fevv8[m] has quit [Ping timeout: 264 seconds]
fevv8[m] has quit [Ping timeout: 264 seconds]
JJJollyjim has quit [Ping timeout: 240 seconds]
JJJollyjim has quit [Ping timeout: 240 seconds]
whitequark[m] has quit [Ping timeout: 240 seconds]
whitequark[m] has quit [Ping timeout: 240 seconds]
Evidlo has quit [Ping timeout: 258 seconds]
Evidlo has quit [Ping timeout: 258 seconds]
blazra has quit [Ping timeout: 240 seconds]
blazra has quit [Ping timeout: 240 seconds]
cesar[m]1 has quit [Ping timeout: 258 seconds]
cesar[m]1 has quit [Ping timeout: 258 seconds]
emily has quit [Ping timeout: 268 seconds]
emily has quit [Ping timeout: 268 seconds]
Guest57260 has quit [Ping timeout: 244 seconds]
Guest57260 has quit [Ping timeout: 244 seconds]
jfng has quit [Ping timeout: 258 seconds]
jfng has quit [Ping timeout: 258 seconds]
vmedea[m] has joined #nmigen
vmedea[m] has joined #nmigen
JJJollyjim has joined #nmigen
JJJollyjim has joined #nmigen
cesar[m]1 has joined #nmigen
cesar[m]1 has joined #nmigen
Evidlo has joined #nmigen
Evidlo has joined #nmigen
whitequark[m] has joined #nmigen
whitequark[m] has joined #nmigen
blazra has joined #nmigen
blazra has joined #nmigen
Guest57260 has joined #nmigen
Guest57260 has joined #nmigen
jfng has joined #nmigen
jfng has joined #nmigen
emily has joined #nmigen
emily has joined #nmigen
fevv8[m] has joined #nmigen
fevv8[m] has joined #nmigen
<d1b2> <4o> https://github.com/personal-army-of-4o/nyanMigen/issues/95 how should i interpret the error message?
<d1b2> <4o> https://github.com/personal-army-of-4o/nyanMigen/issues/95 how should i interpret the error message?
<d1b2> <4o> why do i see errors only when i ask for help...:)
<d1b2> <4o> why do i see errors only when i ask for help...:)
<d1b2> <4o> yeah. cause i create an array of types, not the array of instances
<d1b2> <4o> yeah. cause i create an array of types, not the array of instances
slan has joined #nmigen
slan has joined #nmigen
<slan> Hmm... still trying to figure out how to make my interconnect work. I think I've hit a wall.
<slan> Hmm... still trying to figure out how to make my interconnect work. I think I've hit a wall.
<slan> Context: a cpu, 2 read ports. Goal: fetching and reading memory should happen in 1 cycle if read ports are different, 2 cycles otherwise.
<slan> Context: a cpu, 2 read ports. Goal: fetching and reading memory should happen in 1 cycle if read ports are different, 2 cycles otherwise.
<slan> My problem: simulation works fine, synthesis is reporting 10 combinatorial loops.
<slan> My problem: simulation works fine, synthesis is reporting 10 combinatorial loops.
emeb has joined #nmigen
emeb has joined #nmigen
<slan> At this point, I'm not sure if 1. this is doable 2. this is doable with nmigen 3. there is a bug in the nmigen -> yosys -> vivado chain 4. my implementation is broken
<slan> At this point, I'm not sure if 1. this is doable 2. this is doable with nmigen 3. there is a bug in the nmigen -> yosys -> vivado chain 4. my implementation is broken
<slan> Since I'm a beginner, I'm focusing on 4 but after rewriting and simplifying my design many times I'm getting similar results and I'm running out of ideas on how to investigate further.
<slan> Since I'm a beginner, I'm focusing on 4 but after rewriting and simplifying my design many times I'm getting similar results and I'm running out of ideas on how to investigate further.
<slan> I would be extremely gratefull if somebody could point me in the right direction. The (standalone) code is there: https://github.com/slan/hartysoc/blob/repro/repro.py
<slan> I would be extremely gratefull if somebody could point me in the right direction. The (standalone) code is there: https://github.com/slan/hartysoc/blob/repro/repro.py
<d1b2> <4o> which section of it defines latency?
<d1b2> <4o> which section of it defines latency?
<slan> not sure what you mean... the read ports are combinatorial, cycles are triggered by update pc (sync)
<slan> not sure what you mean... the read ports are combinatorial, cycles are triggered by update pc (sync)
<d1b2> <4o> what "2 read ports" refers to?
<d1b2> <4o> what "2 read ports" refers to?
<slan> rp0 and rp1, the 2 read ports form mem0 and mem1
<slan> rp0 and rp1, the 2 read ports form mem0 and mem1
<d1b2> <4o> cycle == clock cycle?
<d1b2> <4o> cycle == clock cycle?
<slan> yes
<slan> yes
<slan> simulation is working as expected: https://imgur.com/a/04d3A6K
<slan> simulation is working as expected: https://imgur.com/a/04d3A6K
<d1b2> <4o> line 81+ should implement this, right?
<d1b2> <4o> line 81+ should implement this, right?
<d1b2> <4o> this = different read latency
<d1b2> <4o> this = different read latency
<slan> what do you mean?
<slan> what do you mean?
<slan> yes, lines 81+ are where the sync logic is
<slan> yes, lines 81+ are where the sync logic is
<slan> it's actually not about latency, more about port collision between fetching the instaruction and executing it (reading from memory)
<slan> it's actually not about latency, more about port collision between fetching the instaruction and executing it (reading from memory)
<d1b2> <4o> https://github.com/slan/hartysoc/blob/61a30e039b6b6a228beaf8b05675f2a5b87c74a0/repro.py#L82-L88 looks like a latch. i read it as "if condition is true, assign values to signals, otherwise keep current values". this may produce latches cause you do it combinatorically
<d1b2> <4o> https://github.com/slan/hartysoc/blob/61a30e039b6b6a228beaf8b05675f2a5b87c74a0/repro.py#L82-L88 looks like a latch. i read it as "if condition is true, assign values to signals, otherwise keep current values". this may produce latches cause you do it combinatorically
<agg> I don't think you can generate latches in nmigen without instantiating one explicitly/using verilog
<agg> I don't think you can generate latches in nmigen without instantiating one explicitly/using verilog
<d1b2> <4o> challenge accepted
<d1b2> <4o> challenge accepted
<agg> L82-88 will make the comb assignment if the condition is true, otherwise those signals will be zero/any previous comb assignment
<agg> L82-88 will make the comb assignment if the condition is true, otherwise those signals will be zero/any previous comb assignment
<slan> Hmm, I don't think I want/need a latch there...
<slan> Hmm, I don't think I want/need a latch there...
<agg> it's not really a challenge, it's a design of nmigen
<agg> it's not really a challenge, it's a design of nmigen
<d1b2> <4o> "previous comb assignment" is what looks like a latch
<d1b2> <4o> "previous comb assignment" is what looks like a latch
<agg> I mean previous in the code, not in time
<agg> I mean previous in the code, not in time
<slan> Actually in case of a collision I will have dport.addr set by L61, so I don't want to override it
<slan> Actually in case of a collision I will have dport.addr set by L61, so I don't want to override it
<agg> it won't latch, dport.addr and ddata and dack will all be 0 unless that condition is true
<agg> it won't latch, dport.addr and ddata and dack will all be 0 unless that condition is true
<slan> that is fine, this is the case where next cycle will use the cached instruction (and the port will be free)
<slan> that is fine, this is the case where next cycle will use the cached instruction (and the port will be free)
<d1b2> <4o> i don't see any other assignments to dport.addr
<d1b2> <4o> i don't see any other assignments to dport.addr
<slan> in case dport_id is the same as iport_id, L69 will set it
<slan> in case dport_id is the same as iport_id, L69 will set it
<slan> (because dport will be the same as iport)
<slan> (because dport will be the same as iport)
<d1b2> <4o> well it's great if nmigen does zero out signals in implied else branch
<d1b2> <4o> well it's great if nmigen does zero out signals in implied else branch
<agg> slan: oh right I see the dport/iport thing
<agg> slan: oh right I see the dport/iport thing
<d1b2> <4o> true. no latch https://paste.debian.net/1190679/
<d1b2> <4o> true. no latch https://paste.debian.net/1190679/
<agg> slan: your design does have a combinatorial loop, and that's "not allowed"
<agg> slan: your design does have a combinatorial loop, and that's "not allowed"
<agg> e.g. memory output -> iport data -> insn -> daddr -> iport addr -> memory input
<agg> e.g. memory output -> iport data -> insn -> daddr -> iport addr -> memory input
<agg> assuming I'm understanding your design correctly, anyway
<agg> assuming I'm understanding your design correctly, anyway
<agg> something like this https://imgur.com/a/QMriTvO
<agg> something like this https://imgur.com/a/QMriTvO
<slan> daddr -> iport addr should be gated by the "collision" detection
<slan> daddr -> iport addr should be gated by the "collision" detection
<agg> yes, I see
<agg> yes, I see
<agg> you sure are making your life difficult :p
<agg> you sure are making your life difficult :p
<agg> the muxes i drew on the memory address inputs are wrong too, actually
<agg> the muxes i drew on the memory address inputs are wrong too, actually
<slan> The reasoning behind this "exercise" is that I would like my CPU to work with distributed RAM (as L1 cache) backed by BRAM/SDRAM
<slan> The reasoning behind this "exercise" is that I would like my CPU to work with distributed RAM (as L1 cache) backed by BRAM/SDRAM
<slan> So I'm aiming at 1 CPI if possible
<slan> So I'm aiming at 1 CPI if possible
<slan> And the reason I'm thinking of a bug in the nmigen -> yosys -> vivado chain is that if I change L57 with a constant value, everything works as expected
<slan> And the reason I'm thinking of a bug in the nmigen -> yosys -> vivado chain is that if I change L57 with a constant value, everything works as expected
<slan> but I'm losing the ability to run code from different memories
<slan> but I'm losing the ability to run code from different memories
<agg> I still expect there's a combinatorial feedback loop in here, and they're explicitly UB in nmigen
<agg> I still expect there's a combinatorial feedback loop in here, and they're explicitly UB in nmigen
<agg> but maybe not, in which case maybe there's a bug creeping in somewhere instead
<agg> but maybe not, in which case maybe there's a bug creeping in somewhere instead
<agg> (the warning box in particular)
<agg> (the warning box in particular)
<slan> Yes, that's the reason I'm also suspecting my implementation is broken: I think my idea should not create combinatorial loops. Maybe I failed to express my intention to nmigen
<slan> Yes, that's the reason I'm also suspecting my implementation is broken: I think my idea should not create combinatorial loops. Maybe I failed to express my intention to nmigen
<slan> but I've tried to approach the problem from as many angles as I could think of
<slan> but I've tried to approach the problem from as many angles as I could think of
<slan> without much success...
<slan> without much success...
Bertl is now known as Bertl_oO
Bertl is now known as Bertl_oO
<agg> slan: it might help clarify the design if you're more explicit about what drives each read port's addr signal
<agg> slan: it might help clarify the design if you're more explicit about what drives each read port's addr signal
<agg> which rp sources each data signal is very clear, but it's much less obvious what the control signal to the mux on the memory address is
<agg> which rp sources each data signal is very clear, but it's much less obvious what the control signal to the mux on the memory address is
emeb_mac has joined #nmigen
emeb_mac has joined #nmigen
<agg> just a vague thought though
<agg> just a vague thought though
<slan> Maybe I'll try. I'm not used to thinking in terms of mux/circuit since I have no formal education in this. Just played a bit with logisim... that could help calarify
<slan> Maybe I'll try. I'm not used to thinking in terms of mux/circuit since I have no formal education in this. Just played a bit with logisim... that could help calarify
<slan> good idea, thanks
<slan> good idea, thanks
<slan> (agree that the mux driving memory access is tricky)
<slan> (agree that the mux driving memory access is tricky)
emeb_mac has quit [Quit: Leaving.]
emeb_mac has quit [Quit: Leaving.]
<agg> slan: hm, thinking about the mem addr muxes, I think you have a problem where insn (and thus daddr) is fed combinatorially from the two read port datas, and both read port addresses combinatorially depend on daddr
<agg> slan: hm, thinking about the mem addr muxes, I think you have a problem where insn (and thus daddr) is fed combinatorially from the two read port datas, and both read port addresses combinatorially depend on daddr
<agg> even though it should be a _stable_ feedback loop because eventually your conditions are exclusive, it's still a combinatorial loop, I think
<agg> even though it should be a _stable_ feedback loop because eventually your conditions are exclusive, it's still a combinatorial loop, I think
<agg> rp0.addr depends on daddr which depends on insn which depends on rp0.data which depends on rp0.addr, basically, even though once it settles down it will find a stable value
<agg> rp0.addr depends on daddr which depends on insn which depends on rp0.data which depends on rp0.addr, basically, even though once it settles down it will find a stable value
<slan> How can insn be fed by the 2 read ports? Isn't it either from a readport or from the cache?
<slan> How can insn be fed by the 2 read ports? Isn't it either from a readport or from the cache?
<agg> it's from iport which might be rp0 or rp1 combinatorially
<agg> it's from iport which might be rp0 or rp1 combinatorially
<agg> only depending on pc and cache_addr, but the rp0/rp1.addr signal depends on both pc and daddr to select whether it's iport or dport
<agg> only depending on pc and cache_addr, but the rp0/rp1.addr signal depends on both pc and daddr to select whether it's iport or dport
<slan> I don't see it... let's take my example of booting from mem1, reading from rp0 gives: pc -> rp1.addr -> insn -> rp0.addr
<slan> I don't see it... let's take my example of booting from mem1, reading from rp0 gives: pc -> rp1.addr -> insn -> rp0.addr
<slan> reading from rp1 gives: pc -> rp1.addr -> insn -> cache / next cycle cache -> insn -> rp1.addr
<slan> reading from rp1 gives: pc -> rp1.addr -> insn -> cache / next cycle cache -> insn -> rp1.addr
<slan> assuming cache_addr cache_insn are registers there should be no dependency, right?
<slan> assuming cache_addr cache_insn are registers there should be no dependency, right?
<agg> if you look at it the other way, rp0.addr is fed from a combinatorial circuit with inputs pc, cache_addr, daddr, dreq
<agg> if you look at it the other way, rp0.addr is fed from a combinatorial circuit with inputs pc, cache_addr, daddr, dreq
<agg> so is rp1
<agg> so is rp1
<agg> and daddr is a wire that is generated from a combinatorial circuit fed by cache_insn and rp0.data and rp1.data
<agg> and daddr is a wire that is generated from a combinatorial circuit fed by cache_insn and rp0.data and rp1.data
<agg> so the logic generating the rp0.addr signal has the rp0.data signal as an input
<agg> so the logic generating the rp0.addr signal has the rp0.data signal as an input
<slan> I think I see. Although I agree it should be stable.
<slan> I think I see. Although I agree it should be stable.
<agg> unfortunately it being stable doesn't matter
<agg> unfortunately it being stable doesn't matter
<agg> in terms of nmigen, anyway
<agg> in terms of nmigen, anyway
<slan> Hmm... do you think I can turn that stable loop into something nmigne would be happy with?
<slan> Hmm... do you think I can turn that stable loop into something nmigne would be happy with?
<slan> Drawing more (not fully there yet) makes me feel I could have a priority encoder in fromt of the ports to decide if fetch or mem should have access
<slan> Drawing more (not fully there yet) makes me feel I could have a priority encoder in fromt of the ports to decide if fetch or mem should have access
<slan> In practice turning the problem upside down and starting (as you hinted) with the "mux" to mem
<slan> In practice turning the problem upside down and starting (as you hinted) with the "mux" to mem
revolve has quit [Read error: Connection reset by peer]
revolve has quit [Read error: Connection reset by peer]
<slan> AH but no... I need the fetch in any case... maybe I'll finish my drawing and look into instancing a lath (as per nmigen doc)
<slan> AH but no... I need the fetch in any case... maybe I'll finish my drawing and look into instancing a lath (as per nmigen doc)
<slan> ^latch
<slan> ^latch
revolve has joined #nmigen
revolve has joined #nmigen
<slan> I could also have the interconnect as a module with a 2x clock (and make all mem instructions execute in 2 cycles). I'm wondering, in general, how people go about harvard -> modified harvard architecture (which, I believe, is what I'm aiming for)
<slan> I could also have the interconnect as a module with a 2x clock (and make all mem instructions execute in 2 cycles). I'm wondering, in general, how people go about harvard -> modified harvard architecture (which, I believe, is what I'm aiming for)
bvernoux has joined #nmigen
bvernoux has joined #nmigen
<agg> slan: yea, it's tricky, I guess most "serious" designs are pipelined so it stops being a problem
<agg> slan: yea, it's tricky, I guess most "serious" designs are pipelined so it stops being a problem
<agg> if you can make the memory sync that certainly solves it
<agg> if you can make the memory sync that certainly solves it
<slan> How come pipeline solves it? You will have one fetch and 1 mem read per cycle anyways, no?
<slan> How come pipeline solves it? You will have one fetch and 1 mem read per cycle anyways, no?
<agg> i assume the pipeline means the memory becomes synchronous, so there's no longer a combinatorial feedback path through the memory at all
<agg> i assume the pipeline means the memory becomes synchronous, so there's no longer a combinatorial feedback path through the memory at all
<agg> and/or the address input comes from a register from the previous pipeline stage, again breaking the loop
<agg> and/or the address input comes from a register from the previous pipeline stage, again breaking the loop
<agg> you still get 1 cpi, but with a latency equal to the number of stages
<agg> you still get 1 cpi, but with a latency equal to the number of stages
* agg is not a cpu designer by any stretch of the imagination, now at the edge of what I know :p
* agg is not a cpu designer by any stretch of the imagination, now at the edge of what I know :p
ktemkin is now known as gsg-bridge
ktemkin is now known as gsg-bridge
gsg-bridge has quit []
gsg-bridge has quit []
gsg-bridge has joined #nmigen
gsg-bridge has joined #nmigen
gsg-bridge is now known as ktemkin
gsg-bridge is now known as ktemkin
ktemkin has quit [Client Quit]
ktemkin has quit [Client Quit]
ktemkin has joined #nmigen
ktemkin has joined #nmigen
chipmuenk has quit [Quit: chipmuenk]
chipmuenk has quit [Quit: chipmuenk]
emeb_mac has joined #nmigen
emeb_mac has joined #nmigen
jeanthom has quit [Ping timeout: 256 seconds]
jeanthom has quit [Ping timeout: 256 seconds]
bvernoux has quit [Quit: Leaving]
bvernoux has quit [Quit: Leaving]
peeps[zen] has joined #nmigen
peeps[zen] has joined #nmigen
peepsalot has quit [Ping timeout: 240 seconds]
peepsalot has quit [Ping timeout: 240 seconds]
peeps[zen] is now known as peepsalot
peeps[zen] is now known as peepsalot
Raito_Bezarius has joined #nmigen
Raito_Bezarius has joined #nmigen
emeb has quit [Quit: Leaving.]
emeb has quit [Quit: Leaving.]