sb0 changed the topic of #m-labs to: https://m-labs.hk :: Mattermost https://chat.m-labs.hk :: Logs http://irclog.whitequark.org/m-labs
sb0 has joined #m-labs
airwoodix6 has joined #m-labs
airwoodix has quit [Ping timeout: 246 seconds]
airwoodix6 is now known as airwoodix
sb0 has quit [Quit: Leaving]
_whitelogger has joined #m-labs
jaeckel has quit [Ping timeout: 268 seconds]
m4ssi has joined #m-labs
plonk has quit [Read error: Connection reset by peer]
Stormwind_mobile has quit [Ping timeout: 268 seconds]
Stormwind_mobile has joined #m-labs
plonk has joined #m-labs
plonk has quit [Read error: Connection reset by peer]
plonk has joined #m-labs
Stormwind_mobile has quit [Ping timeout: 265 seconds]
<_whitenotifier-e> [nmigen-boards] zignig opened pull request #36: Flashmap - https://git.io/Je1nc
<mtrbot-ml> [mattermost] <dpn> Ah, apologies for all the separate update messages
zng_ has quit [Quit: ZNC 1.7.2 - https://znc.in]
zng has joined #m-labs
en0k has joined #m-labs
en0k has quit [Remote host closed the connection]
en0k has joined #m-labs
k0ne has joined #m-labs
en0k has quit [Ping timeout: 240 seconds]
k0ne has quit [Ping timeout: 240 seconds]
proteus-guy has joined #m-labs
en0k has joined #m-labs
mauz555 has joined #m-labs
mauz555 has quit []
en0k has quit [Ping timeout: 276 seconds]
mauz555 has joined #m-labs
mauz555 has quit [Read error: Connection reset by peer]
en0k has joined #m-labs
m4ssi has quit [Remote host closed the connection]
en0k has quit [Remote host closed the connection]
en0k has joined #m-labs
en0k has quit [Ping timeout: 268 seconds]
en0k has joined #m-labs
m4ssi has joined #m-labs
Stormwind_mobile has joined #m-labs
Stormwind_mobile has quit [Ping timeout: 250 seconds]
m4ssi has quit [Remote host closed the connection]
m4ssi has joined #m-labs
en0k has quit [Remote host closed the connection]
en0k has joined #m-labs
m4ssi has quit [Read error: Connection reset by peer]
massi_ has joined #m-labs
Stormwind_mobile has joined #m-labs
<ZirconiumX> This is possibly cursed, but if I want to implement a state that returns to its "caller", how would I do that? I'm writing an SD card controller, and need a state for performing an SPI transfer, but duplicating it for each SD command seems pointless.
<whitequark> can you elaborate?
<ZirconiumX> Essentially I want my state machine to do a function call
<ZirconiumX> Which means the state after it needs to be the state that called it
<whitequark> this is why people use soft-CPUs
<whitequark> in general
<whitequark> "programmable state machines"
<whitequark> (recommended reading: http://bleyer.org/pacoblaze/picoblaze.pdf)
<whitequark> as for your specific question: probably use two state machines
<whitequark> one to handle SPI, and another to drive it with commands
<ZirconiumX> That's currently how I have it structured, but I still end up needing to repeat the same basic code to drive said SPI state machine
<ZirconiumX> Perhaps I need to make the SPI buffer big enough to fit SD card commands
<ZirconiumX> Though the block data is going to be big enough to be worth putting into a Memory.
<whitequark> can you show your actual code?
<ZirconiumX> Very WIP, but
<ZirconiumX> The SPI controller is a glorified shift register
<whitequark> hm
<whitequark> I don't see any code that drives the SPI state machine yet
<ZirconiumX> At present there is none; I'm thinking aloud as such
<ZirconiumX> For example, the handshake for an SD card in SPI mode requires sending multiple CMDs, and each step of the handshake would require the same basic code to drive the SPI state machine
<ZirconiumX> I suppose what you're saying here is "this should be in software"?
massi_ has quit [Remote host closed the connection]
<whitequark> hmm
<ZirconiumX> I *do* have the luxury of a soft CPU, but I was wondering how much should be in gateware versus software
<whitequark> ideally that code should be 3-4 lines: present the byte, set the ready flag, wait for acknowledgement flag
<whitequark> which is a *bit* annoying, and I've actually thought about adding some tools to factor that out, but isn't unbearable
<ZirconiumX> I'm aware of the embedded-sdmmc crate, but also of size constraints of the bootstrap code
<ZirconiumX> My goal is to fit the bootstrap in a few DP16KDs.
<ZirconiumX> As a wishbone memory device/cache
<whitequark> I think what you want is totally realistic as a set of FSMs
<whitequark> I was more saying that, as your ad-hoc FSMs grow, they start to be closer and closer to a soft-CPU
<whitequark> that isn't a statement that tells you to change your approach; it is a high-level, general observation
<ZirconiumX> Right, okay.
en0k has quit [Ping timeout: 240 seconds]
<Stormwind_mobile> Now, I want to design a softcore with an "annoying bit" hidden somewhere in the flag register.
<ZirconiumX> Jump Sometimes
<davidc__> ZirconiumX: have the cache initially loaded with the boot code (with cache lines "locked"), then exec out of that while you init peripherals
<ZirconiumX> davidc__: that's the plan, yeah
<davidc__> (Heck, you can even use that to do XIP from the SD card, as long as you can trigger an interrupt on "cache miss")
<davidc__> No SD card gateware needed!
<ZirconiumX> Well, not *much* SD card gateware needed.
<davidc__> You could bitbang it!
<ZirconiumX> Not confident in my bitbanging skills
<ZirconiumX> ZipCPU's sdspi core has a nice interface, so I might reuse that