Wednesday, 2022-03-02

*** tpb <[email protected]> has joined #litex00:00
*** shoragan <shoragan!~shoragan@user/shoragan> has quit IRC (Ping timeout: 250 seconds)01:04
*** shoragan <shoragan!~shoragan@user/shoragan> has joined #litex01:05
*** bl0x_ <bl0x_!~bastii@p200300d7a7128c00326952c4bfbb2e3e.dip0.t-ipconnect.de> has quit IRC (Ping timeout: 240 seconds)02:22
*** bl0x_ <bl0x_!~bastii@p200300d7a70ffe004ca26f9ad24b4fff.dip0.t-ipconnect.de> has joined #litex02:25
*** Degi_ <[email protected]> has joined #litex03:11
*** Degi <[email protected]> has quit IRC (Ping timeout: 256 seconds)03:12
*** Degi_ is now known as Degi03:12
*** FabM <[email protected]> has joined #litex07:38
*** zjason` <zjason`[email protected]> has joined #litex11:18
*** zjason <[email protected]> has quit IRC (Read error: Connection reset by peer)11:19
tntHow does one write an async reset register in migen ?11:54
*** zjason` is now known as zjason12:19
acathla_tnt, there is a AsyncResetSynchronizer in migen, not sure if that's what you're looking for but can be inspiring : https://github.com/m-labs/migen/blob/master/migen/genlib/resetsync.py12:32
tntI saw that but there is literally nothing in there ...12:35
acathla_tnt, it's handled by migen because you add it as a "special", and it seems to be platform dependant12:40
tntyeah, but that doesn't help me then :)12:43
tntI basically want like a Signal(8) but with a async reset rather than sync.12:43
acathla_https://m-labs.hk/migen/manual/reference.html?highlight=signal#migen.fhdl.structure.Signal Doc of Signal, not sure it will help much.12:50
tpbTitle: API reference — Migen 0.8.dev0 documentation (at m-labs.hk)12:50
_florent_tnt: Reset is synchronous with Migen, to write an async reset, you have to do it in Verilog  and an instance or use a Xilinx primitive directly13:43
tnt_florent_: tx for confirming what I suspected.14:43
zypcan't you just make a small clock domain for interacting with the particular signal and use an AsyncResetSynchronizer to drive the reset of the domain?15:03
tntThe goal of the reset async in this case would be to ensure reset works (i.e. output signal goes to defined state) when the clokc isn't running.15:04
cr1901This is one of the things amaranth fixes, which has async_reset=True param for Signals15:21
cr1901And indeed, helpful for resets w/o a clock (where only async resets work)15:21
cr1901tnt: Btw, have any idea where this example went? https://github.com/smunaut/ice40-playground/blob/icepick/projects/icepick_test/rtl/sense.v15:24
tntcr1901: mmm, I probably just removed the branch from the public tree since it was for hardware that nobody has.15:29
cr1901Ahhh, I'm just studying this: https://github.com/gregdavill/OrangeCrab-test-sw/blob/main/hw/rtl/analog.py15:29
cr1901Which said it was adapted from your code15:30
tntcr1901: https://gist.github.com/smunaut/bb87ed1ccbf6389977ab2be65f42762515:31
tntYeah, the orange crab analog part is a copy of what I did on the icepick.15:32
cr1901tnt: Thanks, I've been on a bit of an ADC kick lately... hope it ends soon, b/c reading about them for too long makes my head hurt :D15:43
tntlol. I'm not claiming that ADC method is any good btw, but it worked good enough for me.  You could also do sigma-delta with the same external hw but I didn't want a high frequency toggling node. A 'single conversion' kind of thing was more what I needed.15:46
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Quit: Leaving)15:53
cr1901I wanted an interrupt that automatically lets you know when a measurement is done, but that's like 5 lines of code for a LiteX core15:56
cr1901Otherwise, single conversion is fine15:56
tnt_florent_: So I'm faced with the classic "vivado analyzes path it shouldn't" between pcie domain and sys_clk domain.15:59
tntIf I do : platform.add_false_path_constraints(self.crg.cd_sys.clk, self.pcie_phy.cd_pcie.clk)   it doesn't help.15:59
tntIf I do : platform.toolchain.pre_placement_commands.append("set_clock_groups -group [get_clocks -include_generated_clocks -of [get_nets sys_clk]] -group [get_clocks -include_generated_clocks -of [get_nets pcie_clk]] -asynchronous")16:00
tntthen that last one works. The resulting .xdc is the same but the second also has that line in the `.tcl`16:00
_florent_tnt: it could be related to the fact that synthesis of the PCIe PHY/LiteX design are done separately and previous constraint is ignored by Vivado. It's indeed sometimes painful to have false paths applied correctly 16:04
_florent_tnt: that's also some cases where LiteX does not necessarily simplify things with the extra-layers16:05
tntmmm. But the IP are done both before the read_xdc and before the "# Add pre-placement commands" where that also ends up.16:10
tntI guess the [get_clock / get_net ...] might not work because that done before synthesis so those don't exist yet ?16:12
cr1901tnt: (Last q, I promise) What's the point of this line incrementing sense_val by 2? https://gist.github.com/smunaut/bb87ed1ccbf6389977ab2be65f427625#file-sense-v-L15216:19
cr1901err sense_cnt by 2*. It's an edge detector (pos/neg edge of inpt clock), but I don't see why you need to incr by 2 once you've reached the comparator transistion16:19
tntit increments by 1 or 2 depending on which bits are sampled at 1.16:22
tntThe thing (at least in the ice40), at the transition point, it tends to sometime sample a 1, sometimes a 0 and you get a more precise result by counting all the 0 (or all the 1) over a fixed interval rather than measuring the cycles it takes to get to the first one or first zero.16:24
cr1901Oh wait... concat in Verilog is {bit1, bit0} if your signal is declared [1:0] isn't it?16:25
cr1901Okay, this makes sense, I mixed up the concatenation order16:28
cr1901Effectively, you're using both of input_clk's edges to the SB_IO to double the resolution/number of measurements taken16:34
tntcr1901: precisely.18:03
*** zjason <[email protected]> has quit IRC (Remote host closed the connection)20:15
*** zjason` <zjason`[email protected]> has joined #litex20:15
*** zjason` <zjason`[email protected]> has quit IRC (Read error: Connection reset by peer)21:33
*** zjason` <zjason`[email protected]> has joined #litex21:36

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!