Saturday, 2019-12-21

*** tpb has joined #yosys00:00
*** rohitksingh has joined #yosys00:16
*** noname_Matt has joined #yosys00:19
*** noname_Matt has left #yosys00:20
*** noname_Matt has joined #yosys00:21
*** Cerpin has joined #yosys00:24
*** rohitksingh has quit IRC00:46
*** anuejn has joined #yosys01:39
*** rohitksingh has joined #yosys02:08
*** rohitksingh has quit IRC02:28
*** rohitksingh has joined #yosys02:35
*** attie has joined #yosys03:39
*** citypw has joined #yosys03:44
*** attie has quit IRC03:44
*** Thorn has quit IRC04:39
*** rohitksingh has quit IRC04:45
*** _whitelogger has quit IRC05:28
*** _whitelogger has joined #yosys05:30
*** _whitelogger has quit IRC05:40
*** _whitelogger has joined #yosys05:42
*** _whitelogger has quit IRC06:13
*** _whitelogger has joined #yosys06:15
*** _whitelogger has quit IRC06:22
*** _whitelogger has joined #yosys06:24
*** _whitelogger has quit IRC06:37
*** _whitelogger has joined #yosys06:39
*** emeb_mac has quit IRC06:44
*** Jybz has joined #yosys07:28
*** Thorn has joined #yosys08:49
*** rohitksingh has joined #yosys09:11
*** Jybz has quit IRC09:44
*** Jybz has joined #yosys09:48
*** Jybz has quit IRC09:50
*** Jybz has joined #yosys09:57
*** attie has joined #yosys11:41
*** attie has quit IRC11:46
*** adjtm has quit IRC11:49
*** _whitelogger has quit IRC12:31
*** _whitelogger has joined #yosys12:33
*** _whitelogger has quit IRC12:40
*** _whitelogger has joined #yosys12:42
*** fsasm has joined #yosys12:51
*** pie_ has quit IRC13:27
*** vidbina has joined #yosys13:27
*** klotz has joined #yosys13:32
*** pie_ has joined #yosys13:39
develonepi3mmicko From cmd line can set BUILD GUI OFF like -DARCH=ice40?14:22
mmickosure -DBUILD_GUI=OFF14:23
develonepi3mmicko I see -- Configuring architecture : ice40.14:29
develonepi3then -- Configuring incomplete, errors occurred!14:29
develonepi3mmicko this is what I used "-DARCH=ice40 -DBUILD_GUI=OFF ."14:30
mmickoif you do not have boost python add -DBUILD_PYTHON=OFF14:31
develonepi3I do have boost1.71?14:33
janrinzeZipCPU: Your SPI SDcard simulator, is it okay for use in an emulator that uses byte read/write to a memory mapped SPI port?14:35
ZipCPU?14:36
ZipCPUI'm not sure I follow14:36
janrinzeZipCPU: it looks sufficiently comprehensive in that it simulates an SDcard in SPI mode14:36
ZipCPUYes, that's the purpose of it14:36
janrinzehttps://github.com/ZipCPU/sdspi/blob/master/bench/cpp/sdspisim.cpp14:36
tpbTitle: sdspi/sdspisim.cpp at master · ZipCPU/sdspi · GitHub (at github.com)14:36
ZipCPUOkay, we are talking about the same simulator14:37
ZipCPUBut ... what constitutes a "memory mapped SPI port"?14:37
ZipCPUFlash memory?14:37
janrinzeI have an Acorn Atom emulator that uses a hardware SPI port (8bit) that is accessed at a memory address14:37
ZipCPUOkay, but ... that's not specific enough to answer the question14:38
janrinzeso it is a write to that address and a read to see the result14:38
ZipCPUThat doesn't sound similar to the SD card's SPI protocol.14:38
ZipCPUIn the SD card protocol, you write commands such as read or write sector to the card14:38
janrinzethe write triggers the transfer, the read is done after a sufficiently long delay14:39
ZipCPUYou then read/write a sector of data14:39
mmickodevelonepi3: try with this parameter, boost python is usually separate install since it is optional and it is not in default build, so check without python support14:39
janrinzeThe protocol is handled in software14:39
ZipCPUThe SD Card SPI protocol also has a rather complicated start up procedure14:39
janrinzeIt already runs on the FPGA, now i'd like to use the software emulator with the same ROM14:40
ZipCPUWould the flash emulator be more appropriate?14:40
ZipCPUhttps://github.com/ZipCPU/qspiflash/blob/master/bench/cpp/flashsim.cpp ?14:40
tpbTitle: qspiflash/flashsim.cpp at master · ZipCPU/qspiflash · GitHub (at github.com)14:40
ZipCPUThat can handle reading and writing bytes, but again it's not a generic protocol--it's supporting a flash SPI protocol14:41
ZipCPUThe flash requires specific commands to read and write from and to various addresses14:41
janrinzeLet me explain, There is a ROM that implements a filing system and uses the SDcard SPI protocol to interface with the SDcard.14:41
ZipCPUAhh ... okay, so you already know that it's the SD card SPI protocol?14:41
janrinzeYes. It already runs on my FPGA14:42
janrinzecan read/write files on the SDcard.14:42
ZipCPUThat sounds like it'd be worth trying14:42
ZipCPUAre you using Verilator?14:43
janrinzeThe emulator is written in C/C++14:43
ZipCPUOh?  No Verilog?14:43
janrinzeNope. The FPGA design is in verilog though.14:44
janrinzeBut running the Verilator version would cause quite a bit of overhead.14:44
ZipCPUOkay ... so, this still sounds doable, but you might need some more patching to make it work14:44
janrinzeYeah, that's what i am looking at.14:45
ZipCPUThe SDSPI emulator takes CSn, SCK, and MOSI in, and returns MISO as a result14:45
*** martin2250 has joined #yosys14:46
janrinzeI think if i can modify it a little to have a byte interface ( just skipping the SPI clocks and such) it might just work.14:46
ZipCPUI make no warranties or guarantees14:46
ZipCPU:D14:46
janrinze:D understood.14:46
janrinzebottom line is just to have the appropriate communication and responses, including the read and write to a block of memory that holds the SDcard image.14:47
ZipCPUWell ... it might be worth trying14:49
janrinzethere are some ROMs that use bitbanging interfaces that might be more appropriate for more direct implementation of your source code.14:49
janrinzeCan try both solutions.14:49
janrinzeThe SDcard image is a whopping 100MB :-)14:50
ZipCPUWow14:50
janrinzeholds 1024 floppy images :D14:50
ZipCPUHmm ... not sure if I should be impressed or dismayed at that statistic14:50
martin2250Hi everyone! I'm new here and I need some help getting my iCE40 boards working, anyone here who has some experience with the boot/configuration process or who can point me in the right direction?14:51
ZipCPUIt's like saying I can run 50k slide rules all at once to do calculations ...14:51
ZipCPUmartin2250: Were you the one posting to reddit the other day?14:51
janrinzehaha.. 1980's system so we're actually talking about a 6502 system with SDcard :D14:51
martin2250yes, that was me14:51
ZipCPUmartin2250: Welcome to the channel14:51
janrinzehi martin225014:52
janrinzemartin2250: which iCE40 board?14:52
ZipCPUI don't think I've tried configuring any of my iCE40s from flash14:52
janrinzei have.14:52
janrinzemartin2250: using the yosys/nextpnr/icestorm tools?14:53
ZipCPUThe tinyfpga code should be a decent example of what needsd to happen14:53
martin2250I've documented the problems on reddit: https://www.reddit.com/r/FPGA/comments/edgb7y/ice40_wont_finish_configuration/14:53
tpbTitle: iCE40 won't finish configuration : FPGA (at www.reddit.com)14:53
ZipCPUSounds like you are missing a sync word of some type14:55
martin2250it's a basic breakout board for the LP1K-CM36. I've had to connect some pins together to get to inner pins but according to the documentation that should be fine14:55
janrinzemartin2250: mosi miso not swapped? (there were some people with that issue on boards.)14:55
martin2250@ZipCPU did you read the post before the edit? I've tried to do slave configuration and it seems to accept the bitstream, just not actually start up14:56
ZipCPUYeah ... I read it ... it doesn't make sense though, so I'm not sure how to comment on that14:56
ZipCPUI'd be curious to know your answer to janrinze's question14:57
martin2250janrinze I've looked at all traces on the scope and to my eye, the communication seems fine14:57
ZipCPUCan you configure the FPGA at all?14:57
ZipCPUIf you could configure the FPGA at all, you might then be able to determine if the flash works according to spec and pinouts14:58
janrinzemartin2250: I has some trouble with flash not waking up but you see the correct data stream so that's not the cause.14:58
ZipCPUCorrect data streaming into ... the correct pin?14:59
martin2250I didn't get it to work so far. As described in the edit only indication that the bitstream is accepted by the FPGA is the fact that the pins take the correct state14:59
martin2250yes, I've tried swapping pins and it resulted in a short (with CC enabled on the lab supply of course)15:00
janrinzethe pins , meaning the bitstream is loaded and the device is setting up I/O pins to the correct states?15:00
martin2250also it reacts differently when the flash is unprogrammed (it tries 6 times to load an image and then gives up)15:00
janrinzehave you been able to verify your design on a differen HX1K board?15:01
martin2250janrinze when I assign a pin to a state in verilog and use slave configuration, the correct pin gets pulled to the correct level. the pin just doesn't go out of high-impedance mode15:01
ZipCPUThen how do you know it gets pulled to the correct level?  That doesn't make sense ... ?15:02
janrinzeindeed.15:02
develonepi3mmicko I used this, "-DARCH=ice40 -DBUILD_GUI=OFF -DBUILD_PYTHON=OFF .". I get -- Configuring architecture : ice40 then -- Configuring incomplete, errors occurred!  The same without "-DBUILD_PYTHON=OFF".15:02
martin2250according to the datasheets, the bitstream takes effect immediately as it is loaded. when the configuration is finished, the pins go to low-z mode. so it seems the bits end up at the right place in SRAM15:02
janrinzemartin2250: have you tried something like a blinky to see if you can toggle an output at a certain frequency?15:04
martin2250>Then how do you know it gets pulled to the correct level? I've connected a LED +resistor to the pin. so if the pin gets pulled up by a weak pullup, I can see the forward voltage on the scope. when I configure the pin as output/low, the voltage at the pin goes to zero15:04
martin2250same with all pins I've tried15:04
martin2250this doesn't happen if the pin is not configured or configured as an input15:05
ZipCPUOkay ... might it be a CRC issue with the flash image?15:05
janrinzemartin2250: do you have the I/O bank voltages correctly connected?15:05
ZipCPUIf it gets almost all of it, but doesn't finish properly, missing a CRC sounds like a possibility15:05
martin2250janrinze yeah, apart from the 'assign pin' tests, that's what I've tried to get working15:06
ZipCPUjanrinze seems to have the better questions though ...15:06
martin2250a crc issue could be possible, it would fit the behavior, as the CRC is at the end of the file... that said I've used both icestorm and the official tools and both show the same behavior15:07
martin2250IO and core voltages are fine. I've soldered two boards so I don't think it's a soldering mistake15:08
martin2250does the iCE40 accept bitstreams that don't have the crc 'command' before the wakeup? maybe that's worth a try15:09
whitequarkit seems strange that the pin output buffer gets *weakly* enabled15:09
martin2250maybe it's just that the pullup resistor (which is active on an unconfigured device) gets disabled by the bitstream15:10
ZipCPUWouldn't blinky flush that out?15:11
daveshahIt sounds to me like pullups are being configured by the bitstream, but because configuration doesn't finish the global output enable isn't asserted15:12
martin2250ZipCPU yes, that's (probably) why I see the voltage on the pin change when I upload blinky15:12
daveshahso the output drivers don't come on and the design doesn't do anything (internal write enable would be deasserted and FF reset asserted too)15:13
martin2250nextpnr/icestorm and the official tools leave the pullup active for unused pins, so that's why it is different when I change the pin in the bitstream15:13
martin2250daveshah yes, that describes the behavior pretty much perfectly15:14
daveshahThat means either a CRC failures as discussed or a missing wakeup command15:14
daveshahOh, do you have some clock cycles after the bitstream15:15
martin2250the wakeup command is there (checked the bits on the scope). unless it somehow misses a bit and throws off alignment, it should work15:15
martin2250yeah, I've even modified iceprog to conform better to the diagrams from the app note15:15
*** noname_Matt has quit IRC15:16
martin2250I'm using a FT2232 for sending the configuration. the edges look good15:16
martin2250also tried the official lattice programmer at work (at least for flashing the flash chip, not for slave configuration)15:17
daveshahYou could try reducing the clock frequency15:18
daveshahCDONE has a pullup?15:19
martin2250not sure if it will make a difference... both iCE40 and FTDI are rated for much higher speeds. I'll give it a try, give me a minute15:19
martin2250no, CDONE is connected to ground, as I had to make room for a via15:20
janrinze:D15:20
martin2250all the documentation states that CDONE is output only, is this a problem?15:20
tntcdone needs to be high15:20
martin2250oh damn it15:21
tntyea, the fpga will never finish config if cdone isn't pulled high.15:21
tntI got bit by that ... I had a pull up on it and driving a transistor to light up a led ... but it then wouldn't rise above the 0.6v of the base-collector voltage and that prevented the ice40 from finishing config.15:22
martin2250thanks, that should really be much more prominent in the documentation...15:22
martin2250I'll try to scrape the pad off, maybe I can yet save the six boards I ordered... hopefully the FPGA survives the hot air gun treatment15:23
*** vidbina has quit IRC15:25
tntyeah, the doc and hw checklist tells you you need a pull-up but never _why_ and that despite being an output, it need to rise high for the fpga to actually finish config.15:27
*** martin225032 has joined #yosys15:27
martin2250does it have an internal pull up?15:28
tntyes15:29
martin2250(just checked, it does)15:29
martin2250thanks15:29
tntthey do recommend an external one, so I'd add one for 'safety' on any future design, but at least this time you might be able to get the rework working by just dicsonnecting the ball.15:30
tntmaybe you can drill the via out from the other side ?15:30
martin2250if I had enough room to route out the CDONE ball, I wouldn't have had to connect it to GND :P15:31
martin2250the via connects all ground pins of that package, so that won't work15:31
martin2250I'll head off to my workbench, back in a few minutes with good news hopefully. thanks for the help everybody and happy holidays!15:34
*** martin2250 has quit IRC15:34
*** rohitksingh has quit IRC15:46
*** pie__ has joined #yosys15:57
*** pie_ has quit IRC16:00
*** martin2250 has joined #yosys16:41
martin2250Hi again! Slave configuration works now, seems though as if the SPI_SO ball got disconnected, so I'll probably need a few more tries. reballing a BGA is harder than I thought, somehow the solder won't ball up on the chip16:44
martin2250thanks again for your help!16:44
*** emeb has joined #yosys16:46
*** martin2250 has quit IRC16:48
*** gmc has joined #yosys17:00
*** adjtm has joined #yosys17:04
*** pie__ has quit IRC17:11
*** d0nker5 has quit IRC17:21
*** citypw has quit IRC17:25
*** knielsen_ is now known as knielsen17:51
*** markus-k has quit IRC18:30
*** X-Scale has quit IRC18:32
*** markus-k has joined #yosys19:10
*** dys has joined #yosys19:16
*** attie has joined #yosys19:42
*** attie has quit IRC19:47
*** X-Scale has joined #yosys20:29
*** emeb_mac has joined #yosys21:02
*** Jybz has quit IRC21:20
*** fsasm has quit IRC22:39
*** noname_Matt has joined #yosys23:18

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!