clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
emeb has joined #yosys
emeb has quit [Ping timeout: 260 seconds]
emeb has joined #yosys
emeb_mac has joined #yosys
X-Scale has quit [Ping timeout: 252 seconds]
X-Scale has joined #yosys
digshadow has joined #yosys
digshadow has quit [Ping timeout: 260 seconds]
seldridge has joined #yosys
rohitksingh_work has joined #yosys
leviathanch has joined #yosys
emeb has quit [Quit: Leaving.]
seldridge has quit [Ping timeout: 260 seconds]
[X-Scale] has joined #yosys
X-Scale has quit [Ping timeout: 240 seconds]
[X-Scale] is now known as X-Scale
dys has joined #yosys
AlexDaniel has joined #yosys
dys has quit [Ping timeout: 272 seconds]
promach has joined #yosys
<promach> Have anyone faced similar issue at https://www.reddit.com/r/yosys/comments/9hkn8p/yosys_segmentation_fault/ before ?
<sensille> promach: open a ticket with them
<promach> sensille: are you sure that this is not due to my own bug within my own code ?
<sensille> even if it is, "segmentation fault" is not a nice way to point out an error in your source code
emeb_mac has quit [Quit: Leaving.]
<promach> ok, let me have a further look at few more hours on my own before I open a ticket on github
<promach> ok, let me have a further look at my own code for few more hours before I open a ticket on github
<promach> sensille: thanks
AlexDaniel has quit [Ping timeout: 260 seconds]
rohitksingh_work has quit [Ping timeout: 246 seconds]
kraiskil has joined #yosys
AlexDaniel has joined #yosys
AlexDaniel has quit [Ping timeout: 252 seconds]
nonlinear has quit [Remote host closed the connection]
nonlinear has joined #yosys
promach has quit [Ping timeout: 252 seconds]
AlexDaniel has joined #yosys
eightdot has joined #yosys
promach has joined #yosys
dxld has quit [Quit: Bye]
AlexDaniel has quit [Ping timeout: 260 seconds]
dxld has joined #yosys
eightdot has quit [Quit: Changing server]
eightdot has joined #yosys
eightdot has quit [Client Quit]
dxld has quit [Quit: Bye]
eightdot has joined #yosys
dxld has joined #yosys
s_frit has quit [Remote host closed the connection]
s_frit has joined #yosys
develonepi3 has joined #yosys
<mattvenn_> couldn't see your formal test setup - not in the repo? But do you have the formal solvers installed?
<ZipCPU> mattvenn_: promach's been using the formal stuff for a while
<ZipCPU> The problem is that his code is so complex, it's not likely the team will be able to stare at it and instantly discover the problem.
<ZipCPU> Clifford's got a rule that any bug submitted should be an MCVE: Minimal, Complete, Verifiable, Example
<ZipCPU> Minimal usually means less than 20 lines of code, and this isn't that.
<ZipCPU> Complete means that all of the code necessary to reconstruct the problem is represented. promach says this is true, so that would include the test setup you were asking for. (Check the bench directory)
<ZipCPU> Verifiable means that, given his code and setup, you can create the seg fault. I'm going to guess promach has provided that.
<ZipCPU> As I understand the problem, the only difference is past(X,8) and past(X,7) versus past(X,9) and past(X,8).
<ZipCPU> There might truly be an actual bug here ... I doubt anyone has used past(X,9) before. Indeed, I've never (yet) found a reason for past(X,8). The most I've ever needed is past(X,5).
<ZipCPU> The other problem promach has is that he hasn't gated these values. This is unrelated to the crash, though. On the first clock, past(X,8) will reference time-step -8 (a non existant timestep)
<ZipCPU> On the second clock, past(X,8) will reference timestep -7. However, his f_past_valid gate will now be true, so he will be referencing negative time.
<ZipCPU> Any/all asserts of negative time will automatically fail, so either way, with or without seg fault, his design is going to fail at this line.
<ZipCPU> Meh, never mind about that ... he's gated the asserts with the receiver state being in (or past) the stop bit, so that should keep him out of negative time.
cemerick has joined #yosys
<cr1901_modern> I understand by definition that past is invalid on the first timestep, but why is it valid on timestep -7?
<ZipCPU> Timestep -7 has the same problem as timestep -1
<ZipCPU> No difference.
<cr1901_modern> >However, his f_past_valid gate will now be true
<cr1901_modern> Ahhh, so f_past_valid needs to be 0 until 8 timesteps have passed
<ZipCPU> Yes!
<ZipCPU> In this case, though, he's checking his design state.
<ZipCPU> You can't get a uart receiver into the stop bit state without going through at least 8-states, so .... he should be good there.
<ZipCPU> Let me go back to "Verifiable": I'm not getting a segfault with his posted code.
<ZipCPU> Certainly not the one he indicated.
<ZipCPU> That'll make it hard to find and fix whatever bug he had.
AlexDaniel has joined #yosys
cemerick has quit [Ping timeout: 252 seconds]
<ZipCPU> promach: Could not duplicate
AlexDaniel has quit [Remote host closed the connection]
<promach> ZipCPU: I was away just now
<promach> did you duplicate using the original development branch from github ?
<ZipCPU> Yes
<promach> without any code modification from your side ?
<ZipCPU> Correct
<promach> so, you just ran git pull origin development ?
<ZipCPU> I even rebuilt both yosys and SymbiYosys from scratch to make certain I was using the current ones. Results didn't change.
<promach> and went to the bench directory and ran make
<ZipCPU> Yes.
<promach> wait, you missed one step in between
<ZipCPU> ?
<promach> one moment
<promach> if(($past(baud_clk) || (!baud_clk && ($past(tx_state, INPUT_DATA_WIDTH) == 0) && ($past(tx_state, INPUT_DATA_WIDTH+1) == NUMBER_OF_BITS))) && $past(had_been_enabled)) assert(tx_state == 1);
<promach> change line 305 to this
<promach> it would be hard if this does not give the same output with your computer
<promach> ZipCPU: line 305 of test_UART.v
<promach> ZipCPU: even with this modification at line 305, you are still getting no segmentation fault with your computer ?
<ZipCPU> No. Now I am getting a segfault in read_verilog -formal
<ZipCPU> The stack trace goes through the simplify() function in frontends/ast/...
<ZipCPU> The actual segfault is in a call to C++ basic_string
<promach> I am not familiar with yosys internal source code
<ZipCPU> So, yosys is sort of like GCC ... it takes your code through a series of transformations.
<ZipCPU> The first transformation involves reading your code and converting it to an internal yosys format
<ZipCPU> That involves using an "Abstract Syntax Tree" or AST
<ZipCPU> You should be able to google that--there's good reading there.
<promach> ok, which call to C++ basic_string ?
<promach> ZipCPU: is it really not bug from my own code as far as you can reason now ?
<ZipCPU> Still working on that. The default yosys build doesn't include symbols, so GDB isn't much help. I'm rebuilding now with the debug enabled to see if that helps.
<ZipCPU> The basic_string call is being made from the simplify() function in frontends/ast/simplify.cc
<ZipCPU> There's a nasty long level of recursion taking place to get to it, but I can't tell if that's a problem or not.
<promach> ok, I got to go now. I will be back in half an hour
rohitksingh has joined #yosys
emeb has joined #yosys
lutsabound has joined #yosys
promach_ has joined #yosys
<promach_> ZipCPU: how can I help to debug this segfault ? strace does not give much info
<lutsabound> Check the directory SymbiYosys creates for the actual yosys script. Then ryn yosys with that script.
kraiskil has quit [Ping timeout: 264 seconds]
seldridge has joined #yosys
<ZipCPU> promach_: If you just run yosys, using the yosys script in the UART_proof subdirectory, you'll find that yosys is segfaulting on the first line: read_verilog -formal test_UART.v
<ZipCPU> To get more information, I needed to go into the yosys build directory and adjust the Makefile to include debugging symbols and information.
<ZipCPU> If you dig a little further, you'll find the segfault in https://github.com/YosysHQ/yosys/blob/master/frontends/ast/simplify.cc#L1834
<ZipCPU> The problem with that line, in your case is that outreg is NULL.
<ZipCPU> Backing up a bit, num_steps = 0, so outreg is never getting set.
<ZipCPU> Backing up further to https://github.com/YosysHQ/yosys/blob/master/frontends/ast/simplify.cc#L1788 , you'll see where the number of steps is determined.
<ZipCPU> The problem in your code is that the number of steps is both constant and not. Your number of steps is determined by a parameter, not by a constant. It will be constant in the end, but isn't really constant during the evaluation.
<ZipCPU> Had you used a macro or an integer, the line would've worked.
<jer> ZipCPU, hey, did you have a small list at some point that listed a number of kinds of projects ranked in an order if you were to teach a class? or am i misremembering
<ZipCPU> Yeah, I had something like that.
<jer> still have it kicking around by chance?
* ZipCPU is rummaging through folders now
<ZipCPU> Let me post what I have on imgur
<jer> thanks
<ZipCPU> Jer: Consider this diagram ... https://imgur.com/a3SqwQz
<ZipCPU> Does that look anything like what you remember?
<jer> it does
<jer> thanks
<jer> was interested in the formal verification column ordering
<ZipCPU> The three columns are really independent of order
* jer nods
<ZipCPU> They all three need to be learned together.
<ZipCPU> Hence, when working with switches and LEDs, you should be learning Verilator
<ZipCPU> When working with buttons, you'll want to be getting to know VCD files
<ZipCPU> This breaks down with the debugging bus ... that column looks a bit like its out of order.
<ZipCPU> Debouncing should be done when you learn about buttons.
<ZipCPU> Or .... not. You need some form of debugging tool to even know that you need debouncing
<ZipCPU> Perhaps an instructor supplied debugging bus would be best there--yeah, that's what I think I meant when I wrote that.
<jer> yeah so i'm actually digging into adding a debug interface to one of my cores currently, but i've taken a certain path in my getting to know formal verification, and did so mostly independently (save from a few clarifications from others) just curious =]
<ZipCPU> I've also learned formal independently. Indeed, I only just ordered my first text on the topic.
<jer> cool thanks
<promach_> ZipCPU: The problem in my code is that the number of steps is both constant and not ??
<ZipCPU> Yeah ... I'm chasing that down ...
<ZipCPU> So ... it is marked as a constant.
cemerick has joined #yosys
<promach_> I really need time to understand simplify.cc
<promach_> you mean tx_state is marked as constant ?
<ZipCPU> No.
<ZipCPU> That's not the issue.
<ZipCPU> The issue is with INPUT_DATA_WIDTH
<ZipCPU> Is that a constant?
cemerick has quit [Ping timeout: 244 seconds]
<ZipCPU> promach_: I filed an issue on your behalf. Check out issue #642 at https://github.com/YosysHQ/yosys/issues/642
rohitksingh has quit [Quit: Leaving.]
rohitksingh has joined #yosys
AlexDaniel has joined #yosys
maikmerten has joined #yosys
promach_ has quit [Ping timeout: 272 seconds]
rohitksingh has quit [Quit: Leaving.]
rohitksingh has joined #yosys
emeb has quit [Ping timeout: 252 seconds]
emeb has joined #yosys
dys has joined #yosys
leviathanch has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cemerick has joined #yosys
rohitksingh has quit [Quit: Leaving.]
cemerick has quit [Ping timeout: 252 seconds]
lutsabound has quit [Quit: Connection closed for inactivity]
lutsabound has joined #yosys
<cr1901_modern> q3k: Should I mark this issue as closed, because technically it's fixed (even if it doesn't do what I want)?
<cr1901_modern> https://github.com/YosysHQ/nextpnr/issues/69 Posting a link may help
<q3k> i don't think so
<q3k> it's just a temporary hack for now
<q3k> keep it open, i'll review this when I have time
<cr1901_modern> Cool
<cr1901_modern> Also, could you check your privmsg when you get the chance... nothing major
<q3k> yeah, in progress :)
<q3k> currently trying to figure out how the fuck do I rent an apartment
<cr1901_modern> No worries/take your time/etc. Even this counts as a "checkpoint". I just wanted to make sure I didn't do anything stupid/bad :P
<cr1901_modern> This reminds me that there are lots of life events that if they happened right now, I'd be kinda screwed at how to handle them ._.
ym has quit [Quit: Leaving]
maikmerten has quit [Remote host closed the connection]
ym has joined #yosys
mbock has joined #yosys
lutsabound has quit [Quit: Connection closed for inactivity]
mbock has quit [Quit: Leaving.]
develonepi3 has quit [Remote host closed the connection]
develonepi3 has joined #yosys
develonepi3 has left #yosys ["Leaving"]
develonepi3 has joined #yosys
dys has quit [Ping timeout: 250 seconds]
promach_ has joined #yosys
<promach_> ZipCPU: ok
lutsabound has joined #yosys
emeb has quit [Quit: Leaving.]