Monday, 2020-05-18

*** tpb has joined #yosys00:00
*** BinaryLust has quit IRC00:14
*** BinaryLust has joined #yosys00:15
*** smkz has quit IRC00:48
*** zkms has joined #yosys00:49
*** rlee287 has joined #yosys01:24
*** emeb has left #yosys01:39
*** futarisIRCcloud has quit IRC01:45
Forty-BotI having trouble with generate expressions in this code https://gist.github.com/c470f33a232d582e94ef695cfb19c67101:47
tpbTitle: add_pipe.v · GitHub (at gist.github.com)01:47
Forty-BotI get the error ERROR: Left hand side of 1st expression of generate for-loop is not a register! with the first for loop01:48
Forty-Botif I change the type of i and j to reg, I get the error ERROR: Left hand side of 1st expression of generate for-loop is not a gen var! with the last for loop01:48
*** rlee287 has quit IRC02:06
*** citypw has joined #yosys02:06
Forty-Botok turns out that the always block has to go on the inside of the for loops02:34
*** Degi has quit IRC03:19
*** Degi has joined #yosys03:22
ZipCPUForty-Bot: There's more to it03:32
ZipCPUIf you want to use a genvar as a for loop, the always block goes within a generate block03:32
Forty-Bothere's what I ended up doing https://gist.github.com/292dea5094e82ccc3ca604c97a119da803:32
tpbTitle: add_pipe.v · GitHub (at gist.github.com)03:32
ZipCPUOtherwise, it is legal to have a for loop inside an always block--it's just not a generate construct.  In that case, the loop variable needs to be an "integer"03:33
ZipCPUWhere's the "endgenerate" statement in your updated code?03:34
Forty-Botthere's no generate/endgenerate03:34
Forty-Botsince it's optional in the standard, and yosys doesn't seem to care03:35
ZipCPUHmm ... okay, I'll need to go back and check the standard again then03:35
ZipCPUI'd still recommend using `default_nettype none and passing this design through a verilator -Wall pass .... ;)03:36
Forty-Botthe relevant part is section 12.4 in the 5th paragraph03:37
Forty-Bothm, I'm getting some spurious warning from verilator03:40
Forty-Botfor example, it complains about `+:` in the left hand side of line 16 and 1703:40
ZipCPUWhat's the complaint?03:41
Forty-Botit was expecting a `:`03:41
ZipCPUOkay ... looking at your lines there ... is that type of declaration even legal?03:41
Forty-Botyes; it's synthesizing to what I expect03:42
ZipCPUGood luck, then, I'm headed offline for the night03:42
Forty-Botgn03:42
*** BinaryLust has quit IRC05:10
*** gmc has quit IRC06:16
*** dys has joined #yosys06:39
*** X-Scale` has joined #yosys08:19
*** X-Scale has quit IRC08:20
*** X-Scale` is now known as X-Scale08:20
*** Asu has joined #yosys08:23
*** BinaryLust has joined #yosys09:04
*** vidbina has joined #yosys09:44
*** BinaryLust has quit IRC09:44
*** smarter has quit IRC11:02
*** smarter has joined #yosys11:03
*** vidbina has quit IRC11:39
*** jakobwenzel has quit IRC11:46
*** jakobwenzel has joined #yosys11:47
*** futarisIRCcloud has joined #yosys12:08
*** jakobwenzel1 has joined #yosys13:10
*** DaKnig has quit IRC13:46
*** DaKnig has joined #yosys13:49
*** dys has quit IRC14:10
*** vidbina has joined #yosys14:11
*** emeb has joined #yosys14:11
*** jakobwenzel1 has quit IRC14:11
*** citypw has quit IRC14:23
*** citypw has joined #yosys14:24
*** citypw has quit IRC14:29
*** citypw has joined #yosys14:29
*** vidbina has quit IRC14:40
*** jfcaron has joined #yosys14:40
*** citypw has quit IRC14:45
*** jfcaron has quit IRC14:53
*** Asuu has joined #yosys14:55
*** Asu has quit IRC14:56
*** somlo has quit IRC15:02
*** somlo has joined #yosys15:06
*** ayazar has joined #yosys15:46
*** somlo has quit IRC16:12
*** jfcaron has joined #yosys16:57
*** somlo has joined #yosys17:13
*** vidbina has joined #yosys17:22
*** rlee287 has joined #yosys17:56
*** vidbina has quit IRC18:05
rlee287In verilog_backend.cc, "dump_process" is invoked twice: once on line 1717 (right after the warning about mappings is printed) and once on line 1774. (Line numbers are relative to the latest master commit 2d573a0f)18:21
rlee287Is this supposed to be duplicated?18:21
awygleare there good resources on like18:22
awyglephilosophy of formal verification18:22
awyglewhen it's not worth it18:22
awyglewhat it looks like for various types of components18:22
awygleetc18:22
awyglecontext - i have a UDP de-packetizer component and i'm not sure what amount of formal verification is appropriate/useful18:22
ZirconiumXrlee287: Pay close attention to the calls; the first has find_regs = true, and the second has find_regs = false18:24
rlee287OK that makes more sense then18:25
*** rlee287 has quit IRC18:35
*** BinaryLust has joined #yosys18:53
ZipCPUawygle: I'd probably use it for a UDP de-packetizer.  I'd tread carefully around the checksum though19:22
ZipCPUI'd avoid using formal for anything that depends upon the result of a multiply or anything crypto related19:22
ZipCPUI've certainly been quite successful using formal on network stuffs in the past19:23
awygleWhat properties would you verify?19:23
ZipCPUFirst?  Counters19:23
awygleI am having a hard time phrasing properties so they don't sound like "works correctly"19:23
ZipCPUHeh ... Yeah, I can understand that19:23
ZipCPUCan you tell me a bit about what this depacketizer is supposed to do?19:23
ZipCPUI can also point you at my own ethernet cores (and proofs) if you would find them interesting.  I just don't handle UDP in RTL normally19:24
ZipCPUThe trick so far that I've noticed is that the more/better you break down the problem the easier it gets19:24
awygleBasically all it does is accepts a framed data stream, confirms its a valid UDP packet with the correct dport and destination address, and then outputs the payload as a framed stream19:26
awygleTechnically it also handles the IPv4 layer because they're inseparable (I'm still mad about the "pseudo-header")19:27
ZipCPUHmm19:27
ZipCPUI'd strip the IPv4 layer off in one process, then the UDP layer in a second19:28
ZipCPUThat sort of approach really made processing easy19:28
ZipCPU(one process == one module and therefore one proof)19:28
awygleI tried to do that but you need significant information from the IPv4 header to calculate the udp checksum19:28
ZipCPUSuch as ... the length of the packet?19:28
awygleThe layers are not well separated19:29
ZipCPUThe port numbers?19:29
awygleLength, source ip, dest ip, and protocol (which is presumably udp)19:29
ZipCPUSo, imagine processing a stream--on the first word of the stream, all that data should be available to you and constant.  That would all be outputs of the IPv4 handler19:30
awygleYou're also substantially increasing the buffering requirements by doing them separately, if you want to fully validate the ip layer before passing to the udp layer19:31
awygleBecause of the length19:31
ZipCPUYou could send a "cancel" signal to the UDP layer if the validation wasn't complete before the first UDP data sample19:31
ZipCPUThat was one of the things I had done19:32
ZipCPU... cept that was between Ethernet layers and IP layer19:32
sorearall forms of software quality assurance boil down to "say the same thing in two as-different-as-possible ways, and cross-check them"19:33
ZipCPUsorear: That's one of my early slides in explaining formal ;)19:34
awyglelol, true19:37
awyglehm well I'll consider the division a bit more, maybe I'll decide its a good idea19:37
awygleCan you elaborate more on "counters"?19:38
* ZipCPU rummages for an example19:38
ZipCPUThis should be a good example of using a counter with network stuffs, https://github.com/ZipCPU/videozip/blob/dev/rtl/ethernet/rxemin.v19:39
tpbTitle: videozip/rxemin.v at dev · ZipCPU/videozip · GitHub (at github.com)19:40
* ZipCPU looks to see if it really was a good example ...19:40
ZipCPUIt looks okay ...19:40
ZipCPUHere's another way of stating counters: for every request, there should be one response, but that's from a bus context19:41
ZipCPUCounters: Packets of length "N" should have length "N"19:41
ZipCPUCounters --- anything that counts through something.  They tend to be easy to verify, but powerful in effect19:41
awygleI see19:45
ZipCPUOften, I can create a state machine and a master counter to describe how the states are to be moved through.  I can then tie the state machine to the counter, and assertions to it as well.  It makes it easy--if it fits that form.19:46
ZipCPU(SPI fits that form nicely)19:46
*** ayazar has quit IRC21:10
*** jfcaron has quit IRC21:24
*** thardin has left #yosys21:57
*** rlee287 has joined #yosys22:12
*** Asuu has quit IRC22:29
*** cr1901_modern has quit IRC22:31
*** BinaryLust has quit IRC22:33
*** rlee287 has quit IRC23:04
*** emeb has quit IRC23:40

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