clifford changed the topic of #yosys to: Yosys Open SYnthesis Suite: http://www.clifford.at/yosys/ -- Channel Logs: https://irclog.whitequark.org/yosys
<promach_> finnb : use your own local installed iverilog
<promach_> finnb: if I use reg [(NUM_OF_INTERMEDIATE_LAYERS-1):0] middle_layers [0:(SMALLER_WIDTH-1)] [(A_WIDTH+B_WIDTH-1):0]; , yosys-smtbmc gives me out-of-bound array access warnings
<promach_> ZipCPU: is it true that yosys-smtbmc does not support reg [A-1:0][B-1:0][C-1:0] array; ?
<ZipCPU> yosys gives you the error, or yosys-smtbmc?
<promach_> ZipCPU: sby
<ZipCPU> Sigh. That doesn't answer the question. To my knowledge, yosys itself doesn't support multi-dimensional arrays
<promach_> ZipCPU: ok, so I cannot do formal verification of this code using sby ?
<ZipCPU> I'm not even sure the SMT format supports multidimensional memories
<ZipCPU> Perhaps this isn't a memory?
<promach_> huh ? it is still a 3d array, whether it is memory or not
<promach_> ZipCPU: I thought the only difference noticeable by the tool is either the array is packed or unpacked
promach_ has quit [Quit: WeeChat 2.3]
emeb_mac has joined #yosys
emeb has quit [Quit: Leaving.]
X-Scale` has joined #yosys
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
gsi_ has joined #yosys
gsi__ has quit [Ping timeout: 245 seconds]
xdeller_ has quit [Read error: Connection reset by peer]
xdeller_ has joined #yosys
proteusguy has joined #yosys
leviathanch has joined #yosys
jevinskie has joined #yosys
rohitksingh_work has joined #yosys
pie__ has joined #yosys
pie___ has quit [Ping timeout: 245 seconds]
dys has quit [Ping timeout: 240 seconds]
emeb_mac has quit [Ping timeout: 245 seconds]
dys has joined #yosys
rohitksingh_work has quit [Read error: Connection reset by peer]
rohitksingh_work has joined #yosys
dys has quit [Ping timeout: 244 seconds]
m4ssi has joined #yosys
X-Scale` has joined #yosys
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
leviathanch has quit [Remote host closed the connection]
rohitksingh_work has quit [Read error: Connection reset by peer]
rohitksingh has joined #yosys
rohitksingh has quit [Read error: Connection reset by peer]
rohitksingh has joined #yosys
<somlo> daveshah: I haven't taken care of the uart's "back-pressure" wait signal -- in the attosoc setup it effectively stalls the mmio write, but with the rocket, through the layers of AXI interfaces, there's no simple way to do that from where I hooked it up
<daveshah> I found the problem with the UART. It was actually the PLL's feedback config being wrong, throwing the freq off
<somlo> so we'd have to add some sort of buffering to get all the uart output queued up properly
<tpb> Title: GitHub - daveshah1/yoloRISC: porting lowRISC to yosys/nextpnr/trellis on the Lattice ECP5 fpga (at github.com)
<somlo> ah, I redid the pll and started the compilation last night, then went home -- so I just got back and was going to try it out :)
<daveshah> Compile time should be down to 15 minutes synth and PnR with that analytic placer PR
<somlo> and yeah, tweet away if you think it's worth it :)
<somlo> was going to try that today too
<somlo> all we need now is a DRAM controller and we can have a self-hosting Linux computer that can fully recompile its own "hardware"
* sxpert wonders why we keep using Dram on those fpga boards, when srams are so cheap
<daveshah> sxpert: SRAM is much more expensive for a given capacity
<sxpert> I see
<sxpert> and dram is a PITA to work with
<daveshah> SDRAM is fine
<daveshah> it's the more modern DRAMs that are a pain (but the fancier modern SRAMs are not super easy either)
<daveshah> But largest available SRAM (288Mbit) is ~$300, whereas 1Gbit of DDR3 is ~$3 (single quantity pricing)
<daveshah> so you can see why DRAM becomes preferable
<sxpert> ah, I see indeed
<sxpert> I understand that SRAM is much lower power
<sxpert> so that may be preferable for a portable app
<daveshah> In practice large SRAMs are performance optimised and pretty power hungry
<daveshah> smartphones manage fine with low power DRAM
<sxpert> my app would need about 1MB of ram
<daveshah> That is definitely SRAM territory
<daveshah> or perhaps HyperRAM, which is DRAM with a simpler and lower pin count interface
<sxpert> found some at digikey that would fit with 60mA consumption or so, for 5€
<daveshah> That seems like a lot of current for SRAM
<sxpert> or maybe I didn't read that properly ;)
Cerpin has joined #yosys
<sxpert> was looking at this one http://www.issi.com/WW/pdf/61-64WV51216EDBLL.pdf
<sxpert> or that one, don't remember http://www.issi.com/WW/pdf/61-64WV51216EDBLL.pdf
<sxpert> daveshah: anyhow, getting ahead of myself... last night I heeded your advice and rewrote most of the code I had
FL4SHK has quit [Quit: WeeChat 2.3]
<MoeIcenowy> daveshah: does HyperRAM have self-refresh?
<daveshah> Yes, it does
<sxpert> not much choice there though
<sxpert> funny how that looks strangely similar to what is described in the saturn CPU docs ;)
<somlo> daveshah: how did you come up with the pll parameters? I just ran ecppll from the command line and got something different (which btw, doesn't work :) )
<daveshah> I ended up using Diamond
<somlo> oh, fair enough :)
rohitksingh has quit [Ping timeout: 246 seconds]
<somlo> daveshah: what does uart_dbg do on the versa5g?
<daveshah> That connects to pin 4 on X3 (EXPCON1), so I could look at the UART with a logic analyser
<somlo> semi-related: dropping down to 9600 baud helps avoid overwhelming the UART, or was that accomplished just by fixing the pll? (I *still* haven't recompiled it, just studying your changes :)
rohitksingh has joined #yosys
<somlo> daveshah: oh, I see you added a 2000 delay in putchar, that's probably what avoids dealing with the "wait" signal :)
<daveshah> The 9600 was a test in case the baud rate accuracy of 115200 at 10MHz was too poor
<daveshah> 115200 should be fine now too
<MoeIcenowy> oops
<MoeIcenowy> hyperram seems to be bga
AlexDaniel has joined #yosys
<daveshah> MoeIcenowy: yeah, if you don't want BGA then QSPI PSRAM is the best bet
rohitksingh has quit [Ping timeout: 245 seconds]
finnb has joined #yosys
<finnb> Any idea what this yosys error message means?
<tpb> Title: ERROR: Found error in internal cell \mandelbrot.$lt$projects/mandelbrot/hdl/mand - Pastebin.com (at pastebin.com)
<daveshah> finnb: Seems to be signedness related
<tpb> Title: yosys/rtlil.cc at master · YosysHQ/yosys · GitHub (at github.com)
<daveshah> quite possibly an internal bug in the frontend or optimisation
<finnb> interesting
<finnb> I basically have a value which is "if foo > -BAR" where localparam BAR = $sqrt(BAZ)
<finnb> where foo is a signed register
<finnb> I can solve it if I calculate manually what BAR is
<finnb> i.e BAR = 64
<ddrown> what about -1*BAR
<finnb> Only seems a problem when using $sqrt
<daveshah> Let me have a look
<daveshah> Seems like a Yosys bug
<tpb> Title: escaped_i[0] <= ((im + im_c_pipe[WIDTH + 1]) > MAX_SQUARE) - Pastebin.com (at pastebin.com)
<finnb> that's the actual part which fails
<finnb> where MAX_SQUARE is -BAR in my example
<daveshah> finnb: I've created https://github.com/YosysHQ/yosys/issues/807
<tpb> Title: "Found error in internal cell" when comparing signed against negated square root · Issue #807 · YosysHQ/yosys · GitHub (at github.com)
<finnb> Thanks :)
<finnb> so it wasn't just me then
<cr1901_modern> Excellent daveshah :) https://github.com/YosysHQ/nextpnr/pull/228 Unfortunately I kinda forgot why I wanted this in the first place (it's been a busy month) :P
<tpb> Title: ecp5: Embed baseconfigs in nextpnr by daveshah1 · Pull Request #228 · YosysHQ/nextpnr · GitHub (at github.com)
m4ssi has quit [Remote host closed the connection]
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
finnb has quit [Remote host closed the connection]
rohitksingh has joined #yosys
m4ssi has joined #yosys
m4ssi has quit [Client Quit]
rohitksingh has quit [Ping timeout: 250 seconds]
m4ssi has joined #yosys
m4ssi has quit [Remote host closed the connection]
<somlo> daveshah: after getting derailed several times by unrelated dayjob stuff, I finally managed to test the rocket-chip blinky bitstream, and (spoiler alert) -- it works! :)
<somlo> amazing how I could just throw rocket at yosys/trellis/nextpnr and it "Just Worked", practically out of the box -- awesome toolchain, many thanks for your hard work on it!!!
<daveshah> Awesome
<daveshah> Thanks for your work getting this running too!
<somlo> next on the agenda is for me to take nextpnr PR#219 for a spin, and report back some additional before/after run time datapoints
dys has joined #yosys
<sxpert> I have 2 20 bits reg, how can I do an unsigned >= ?
mjoldfield has quit []
<ZipCPU> sxpert: The same way as always?
<ZipCPU> I must be missing something
<sxpert> nah, I was ;-)
<sxpert> the thing ended up being replaced with a bunch of assign and wires
<sxpert> and substractions, grabbing the carry
<ZipCPU> Cool! You are on your way
* ZipCPU is writing a blog article about how fast a CPU can toggle a GPIO pin
<tpb> Title: hp-saturn/hp48_02_sys_ram.v at master · sxpert/hp-saturn · GitHub (at github.com)
<sxpert> see here ;-)
<ZipCPU> Are you working off your own bus standard, or one of the ones I'm less familiar with?
<sxpert> ZipCPU: I'm replicating an HP48, so I'm replicating the bus it uses internally
<ZipCPU> You know what I'm going to recommend, right? ;)
<sxpert> nope
<ZipCPU> I'm going to recommend you build a file containing formal properties associated with any bus interaction. You can then include that file in any design that interacts with the bus and verify that the bus acts "appropriately" (whatever that means)
<ZipCPU> It's an easy/cheap bang for your buck, and one of the easiest and most useful bits of formal to do
<sxpert> oh, I rewrote the thing from scratch over the evening last night
<ZipCPU> Add in the formal properties .... you'll go faster
<sxpert> and separated bus and decoder as much as possible
<sxpert> it was going faster at last compile, 120Mhz or so
<ZipCPU> Which chip? iCE40?
<sxpert> ESP5
<ZipCPU> Nice
<ZipCPU> Have you ever tried the formal tools?
<sxpert> nope
<ZipCPU> Your missing a real treat
<sxpert> hah
<ZipCPU> If you save them for later, though, you'll be missing out on their biggest utility
<ZipCPU> Some folks like the idea of building a design, then verifying it. On the other hand, if you use formal while building your design, it gets a whole lot easier to design
<sxpert> my formal method is paper & pen
<sxpert> and lots of scribbling
<ZipCPU> Mine used to be a test bench wrapper and simulation. Then I tried formal, and realized how many bugs I'd been missing.
<ZipCPU> After getting *REALLY* burned by some ugly bugs that were painful to find in hardware, I've been starting with formal. *Especially* for any sort of bus interaction.
<sxpert> well the bus interaction is entirely inside the fpga, between modules
<sxpert> not with outside things for now
<ZipCPU> Well, both
<ZipCPU> The problem with a bus bug is that it tends to cause the design to freeze and lock up hard, leaving you with no idea what just happened
<ZipCPU> Getting unstuck from there can take a lot of work. Formal can keep that from happening in the first place
<sxpert> yeah
<sxpert> I did the classic 4 phase clocking here
<ZipCPU> Here, try this bug story out for size: http://zipcpu.com/zipcpu/2017/12/28/ugliest-bug.html
<tpb> Title: Mystery post: The ugliest bug I've ever encountered (at zipcpu.com)
<ZipCPU> See if you can guess where the bug was (it's revealed at the end)
<sxpert> I see
<ZipCPU> Since writing that, I discovered formal. Finding and fixing that bug was quite painful. I prefer avoiding such pain, if at all possible. ;)
<sxpert> well, nextpnr complains about there beeing combinatorial loops...
<sxpert> ahem
<ZipCPU> Lol
<sxpert> last time around it was using 600 slices, it uses 43000 now, wtf ?
<ZipCPU> What uses 43k? Your design?
<ZipCPU> Check your multiplies
<sxpert> yeah
<sxpert> no multiplies
<ZipCPU> That and any block RAM
<sxpert> ah
<sxpert> that may be the issue
<sxpert> I have reg [3:0]sys_ram [0:SYS_RAM_LEN - 1];
<ZipCPU> How big is SYS_RAM_LEN/
<ZipCPU> ?
<sxpert> normally should be 256k 4 bit values
<sxpert> I limited to 64k at this time
<ZipCPU> Oh, and why only 4-bits wide? Some block RAM's (iCE40) have a minimum width of 16 bits or so
<sxpert> oh !
<daveshah> ECP5 BRAM are fine at 4 bits
<daveshah> I'm pretty sure iCE40 are too
<daveshah> It's bitstream configurable
<sxpert> guess it didn't generate blockrams for that
<ZipCPU> daveshah: Do you remember what some of the block RAM synthesis problems are that someone might find with an ECP5?
<sxpert> is there a magic incantation ?
<daveshah> The most common problem would be more than one write port
<daveshah> Or possibly excessively complex read/write enable logic
<ZipCPU> Do the write and read ports need to share a common address?
<daveshah> Not in the modes that Yosys supports
<sxpert> daveshah: all writes are in the same always ()
<sxpert> at only one location even
<daveshah> In that case it's probably https://github.com/YosysHQ/yosys/issues/710
<tpb> Title: Yosys fails to infer BRAM with complex enable logic · Issue #710 · YosysHQ/yosys · GitHub (at github.com)
<daveshah> Looking at your code the BRAM access is deep inside a state machine
<ZipCPU> Ok, that's the problem
<daveshah> Yosys can struggle with that sometimes
<sxpert> ah
<ZipCPU> You can't place multiple block RAM reads from the same block RAM into an always block
<sxpert> I see
* sxpert refactors
* sxpert adds more enable wires
<ZipCPU> sxpert: Check out the basic block RAM rules in this tutorial file: http://zipcpu.com/zipcpu/2017/12/28/ugliest-bug.html
<tpb> Title: Mystery post: The ugliest bug I've ever encountered (at zipcpu.com)
<ZipCPU> Sorry, wrong link
<ZipCPU> Rule #3: Don't put a RAM in a cascaded if (or case statement for that matter)
<ZipCPU> Rule #5: Don't put a RAM in a block with other things--not all synthesizers can handle it
tpb has quit [Remote host closed the connection]
tpb has joined #yosys
svenn has quit [Quit: The Lounge - https://thelounge.chat]
svenn has joined #yosys
<tpb> Title: hp-saturn/hp48_02_sys_ram.v at master · sxpert/hp-saturn · GitHub (at github.com)
<sxpert> seems to be fixed
<sxpert> ah, there's still something wrong though