sb0 changed the topic of #m-labs to: ARTIQ, Migen, MiSoC, Mixxeo & other M-Labs projects :: fka #milkymist :: Logs http://irclog.whitequark.org/m-labs
fengling has joined #m-labs
cr1901_modern has quit [Ping timeout: 252 seconds]
cr1901_modern has joined #m-labs
<sb0> xcombelle, thanks!
<sb0> have you tried it?
<xcombelle> sb0 I did not hardware thing since the engineer school, 15 years ago but I would love to do. The only problem is that I'm not manual at all, so a board with all ready would be ideal, but I don't know which one choose
<sb0> maybe pipistrello?
<cr1901_modern> Pipistrello seems like a decent mid-level board
fengling has quit [Ping timeout: 240 seconds]
<whitequark> bb-m-labs: force build --props=package=rustc conda-lin64
<bb-m-labs> build forced [ETA 32m30s]
<bb-m-labs> I'll give a shout when the build finishes
<GitHub192> [rust] whitequark force-pushed artiq from 5e1389d to d838efe: https://github.com/m-labs/rust/commits/artiq
<GitHub192> rust/artiq 8f76f93 Isaac Andrade: Add mention to RFC 940 in the Rust Reference....
<GitHub192> rust/artiq 5943507 Jorge Aparicio: fix built-in target detection...
<GitHub192> rust/artiq ba6ce12 Isaac Andrade: Improve language.
<GitHub8> [conda-recipes] whitequark pushed 1 new commit to master: https://github.com/m-labs/conda-recipes/commit/d34b0bd747986b642aeb06c7b7d45ddef73b1674
<GitHub8> conda-recipes/master d34b0bd whitequark: rustc: update to 1.12.0.
fengling has joined #m-labs
mumptai has joined #m-labs
<bb-m-labs> build #193 of conda-lin64 is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/conda-lin64/builds/193
mumptai has quit [Remote host closed the connection]
<GitHub49> [rust] whitequark force-pushed artiq from d838efe to 0095fa4: https://github.com/m-labs/rust/commits/artiq
<GitHub49> rust/artiq d9e9164 whitequark: Fix LLVM version check.
<GitHub49> rust/artiq 877d3b4 whitequark: Add OR1K support.
<GitHub49> rust/artiq 0095fa4 whitequark: Add mini-libc (only works on OR1K).
<whitequark> bb-m-labs: force build --props=package=rust-core-or1k conda-lin64
<bb-m-labs> build forced [ETA 45m19s]
<bb-m-labs> I'll give a shout when the build finishes
<GitHub45> [conda-recipes] whitequark pushed 1 new commit to master: https://github.com/m-labs/conda-recipes/commit/60828ebc6637038042ca9962e65d72040022bdd7
<GitHub45> conda-recipes/master 60828eb whitequark: rust-core-or1k: add.
<bb-m-labs> build #194 of conda-lin64 is complete: Failure [failed conda_build] Build details are at http://buildbot.m-labs.hk/builders/conda-lin64/builds/194
<whitequark> bb-m-labs: force build --props=package=rust-core-or1k conda-lin64
<bb-m-labs> build forced [ETA 45m19s]
<bb-m-labs> I'll give a shout when the build finishes
<GitHub142> [conda-recipes] whitequark force-pushed master from 60828eb to 10cb15a: https://github.com/m-labs/conda-recipes/commits/master
<GitHub142> conda-recipes/master 10cb15a whitequark: rust-core-or1k: add.
<bb-m-labs> build #195 of conda-lin64 is complete: Failure [failed conda_build] Build details are at http://buildbot.m-labs.hk/builders/conda-lin64/builds/195
<whitequark> bb-m-labs: force build --props=package=rust-core-or1k conda-lin64
<bb-m-labs> build forced [ETA 45m19s]
<bb-m-labs> I'll give a shout when the build finishes
<GitHub16> [conda-recipes] whitequark force-pushed master from 10cb15a to 15bbcc3: https://github.com/m-labs/conda-recipes/commits/master
<GitHub16> conda-recipes/master 15bbcc3 whitequark: rust-core-or1k: add.
<sb0> sigh, laser wavelength meters are expensive
<bb-m-labs> build #196 of conda-lin64 is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/conda-lin64/builds/196
<whitequark> bb-m-labs: force build --props=package=rust-core-or1k conda-lin64
<bb-m-labs> build forced [ETA 24m35s]
<bb-m-labs> I'll give a shout when the build finishes
<GitHub26> [conda-recipes] whitequark pushed 1 new commit to master: https://github.com/m-labs/conda-recipes/commit/58da0701d9c036816949a8b425c7e15b4aa01de2
<GitHub26> conda-recipes/master 58da070 whitequark: rust-core-or1k: add a runtime dependency on rustc too....
<bb-m-labs> build #197 of conda-lin64 is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/conda-lin64/builds/197
<whitequark> sb0: ok, the toolchain is done
<sb0> what do you mean by toolchain? I thought you were able to run a basic "hello world" program already
<whitequark> yes, but that didn't have rust's stdlib
<whitequark> so that was just the compiler, not the toolchain
<rjo> whitequark: no arc?
<whitequark> rjo: no Arc.
<whitequark> since OR1K's atomics are pretty broken.
<whitequark> I could probably hack Rust's stdlib to only use 32-bit atomics, as opposed to all sizes up to 32-bit, in which case they map directly to OR1K's instructions
<rjo> maybe we can just fix the isa.
<whitequark> that's an option. are you willing to coordinate this with OR1K people?
<rjo> potentially willing but probably unqualified
<whitequark> I can figure out the instruction encoding and *probably* capable of fixing mor1kx
<whitequark> (the encoding is an annoying issue; there is no nearby hole for 8-bit/16-bit instructions like there was for normal loads and stores, so it'll have to be tucked somewhere else)
<sb0> if we start to run on modified or1k, we can also clean up the interrupt vector silliness while we're at it
<whitequark> I think the idea is to run on upstream or1k, but fix the upstream
<rjo> is it obvious why rust wants 8 and 16 bit atomics?
<whitequark> yes. the OS-independent standard library defines atomic variants of primitive types. AtomicBool (which is u8). lots of others.
<rjo> i see. but for Arc just a 32 bit atomic would be sufficient. is that what you mean by hack?
<whitequark> yes.
<whitequark> well, actually I just found a less horrible way to do it.
<whitequark> rustc has code like:
<whitequark> for &i in &[8, 16, 32, 64, 128] {
<whitequark> if i <= max_atomic_width {
<whitequark> ret.push(mk(InternedString::new("target_has_atomic"), intern(&s)));
<whitequark> we could probably add a min_atomic_width.
key2 has joined #m-labs
<GitHub172> [artiq] sbourdeauducq pushed 2 new commits to master: https://git.io/v6gCY
<GitHub172> artiq/master c4d1713 raghu: added sync for AD9914
<GitHub172> artiq/master 23b7048 Sebastien Bourdeauducq: dds: make init_sync accessible for AD9914 only
key2 has quit [Ping timeout: 264 seconds]
key2 has joined #m-labs
<whitequark> rjo: ohhhhh
<whitequark> nope, that won't work
<whitequark> well
<whitequark> the restriction to 32-bit atomics only did work
<whitequark> the problem is htat Arc uses a 32-bit compare-exchange primitive
<whitequark> and there is no way to implement it in or1k short of doing a regular compare-exchnage and disabling interrupts around it
<whitequark> let me recheck that I've read the manual correct
<whitequark> nevermind, I misunderstood the ISA. l.lwa/l.swa are an LL/SC primitive
<rjo> i always took cmpxchg to be *the* fundamental atomic operation that everything circles around.
<whitequark> RISC CPUs usually do ll/sc.
<rjo> if i can't do cmpxchg with or1k i'd be worried.
<whitequark> as in, reserve and load, then store, or don't store and set a flag if the reservation was broken
<whitequark> so cmpxchg translates into a loop
<rjo> ok. so you can build cmpxchg with ll/sc then, i guess?
<rjo> ok
<whitequark> it's kind of obnoxious to.
<whitequark> but i can do it, yes.
<bb-m-labs> build #599 of artiq-kc705-nist_clock is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq-kc705-nist_clock/builds/599
<rjo> whitequark: afaict this is also what linux does: offer cmpxchg() as a C api on all archs. build it from ll/sc where it is not native.
<whitequark> LLVM is supposed to do that
<whitequark> by which I mean the backend author is supposed to implement that. by which I mean me.
<bb-m-labs> build #310 of artiq-win64-test is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq-win64-test/builds/310
<larsc> it not that difficult to build a CAS with LL/SC, but if you then use that CAS operation for your other atomic primitives they might get slightly less optimal
<whitequark> naw, the LLVM backends use the same loop scaffold for all atomic primitives
<bb-m-labs> build #876 of artiq is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq/builds/876
<larsc> but you will get a extra load that way no?
<rjo> whitequark: and it looks like missing 1 and 2 byte atomics are a common topic. http://lxr.free-electrons.com/source/arch/sh/include/asm/cmpxchg-xchg.h
<whitequark> larsc: how so?
<whitequark> rjo: well if OR1K had a constant endianness, that would have been easy
<larsc> whitequark: ll/sc atomic looks like: do { ll; modify; } while (!sc);, right?
<whitequark> but it doesn't. it's configurable
<whitequark> larsc: correct
<rjo> whitequark: ack
<sb0> what do we need the atomics for? aren't we going to use solely coroutines?
<sb0> it that just for the sake of making a complete port?
<whitequark> for the sake of not hacking up stdlib, removing most possibility of using external code
<whitequark> rjo: larsc: ok. i found a truly horrifying piece of code in LLVM that implements this stuff for MIPS
<whitequark> so I think I can adapt that and get it done quickly
<larsc> whitequark: and if you change that to cas with ll/sc would it be something like: do { load -> old; modify -> modify; ll -> old2; } while (!sc && old2 == old);
<larsc> modify -> new
<whitequark> how exactly?
<whitequark> I don't understand
<larsc> cas; atomic is do { old = val; modify val; } while (cas val old);
<whitequark> where does cas come from?
<larsc> with a load old at the beginning
<larsc> hardware instruction
<larsc> compare-and-change
<larsc> compage-and-save
<larsc> bah
<whitequark> or1k doesn't have a CAS...
<larsc> compare-and-save
<whitequark> compare-and-swap
<larsc> right
<larsc> so you emulate it with ll/sc, as far as I understood
<whitequark> no
<whitequark> I emulate every supported atomic with ll/sc
<larsc> ok
<larsc> that's what I missed
<larsc> the way I understood it you have to implement a cmpxchg like operation and then all the other atomics are build from that
<GitHub19> [artiq] sbourdeauducq pushed 1 new commit to master: https://git.io/v6grF
<GitHub19> artiq/master 4e3bb01 Sebastien Bourdeauducq: gui/log: support copying entries to clipboard. Closes #280
<bb-m-labs> build #600 of artiq-kc705-nist_clock is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq-kc705-nist_clock/builds/600
<sb0> rjo, what do we do with #40?
<bb-m-labs> build #311 of artiq-win64-test is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq-win64-test/builds/311
<bb-m-labs> build #877 of artiq is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq/builds/877
fengling has quit [Ping timeout: 240 seconds]
<key2> I am trying to connect a module that has a wishbone slave and master bus
<key2> I wonder if I connected it properly regarding the dat_r and dat_w, could someone have a look ?
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
cr1901_modern1 has joined #m-labs
<whitequark> rjo: I am correctly told on #llvm that the MIPS hack is not sufficient
<whitequark> because if neighboring data is modified through a non-atomic instruction, the LL/SC loop will overwrite it
cr1901_modern has quit [Ping timeout: 276 seconds]
cr1901_modern1 is now known as cr1901_modern
<cr1901_modern> (Warning: I'm clueless here) How would neighboring data be modified through a non-atomic instruction before the loop was over? I thought the entire point of an LL/SC loop or anything similar is that it will run to completion, without being interrupted, before doing anything else.
<whitequark> SMP. interrupt.
<cr1901_modern> Ahhh, an interrupt is possible after each iteration of the loop (after each LL/SC is done)?
<whitequark> an interrupt is always possible.
<whitequark> if you just disabled interrupts you wouldn't need LL/SC (on uniprocessor anyway)
<cr1901_modern> whitequark: Sorry, sloppy terminology. Yes an interrupt is always possible. What I meant was an interrupt will be acknowledged AFTER the loop, but not during the LL/SC. Is this correct?
<cr1901_modern> AFTER each iteration*
<whitequark> no
<cr1901_modern> Oh... LL/SC isn't a single instruction. My mistake.
<cr1901_modern> Nevermind, I don't understand what LL/SC does
<rjo> sb0: i'll be finished with the other two documentation items tonight.
<rjo> sb0: i am divided how i would implement #40.
<rjo> sb0: either with the latencies held in the device_db and then applied as part of the TTL* devices.
<rjo> or with user defined wrapper classes. but those would not have a nice way of holding the values (other than being "hardcoded").
<rjo> sb0: if you feel you have an idea how to do that (either purely documentation or with a handfull of device_db extensions added), please go ahead.
<rjo> whitequark: i don't know whether i read that right but i think the kernel just assumes that stuff is always 4 byte aligned and the neighboring data is unused. does rust then assume 1-byte packability for an atomic 8 bit type?
<whitequark> it does not assume that it won't happen
<whitequark> indeed, an array of AtomicBool would be closely packed
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
rohitksingh has joined #m-labs
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
<key2> sb0: hey what was the name of the fancy CPU you told me a couple of days ago ? remember ?
<sb0> OPA
<sb0> terpstra/opa
<sb0> there are irc logs, too
fengling has joined #m-labs
rohitksingh has quit [Ping timeout: 265 seconds]
fengling has quit [Ping timeout: 240 seconds]
rohitksingh has joined #m-labs
fengling has joined #m-labs
mumptai has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
key2 has quit [Ping timeout: 264 seconds]
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
rohitksingh has quit [Quit: Leaving.]
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
mumptai has quit [Remote host closed the connection]
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]
fengling has joined #m-labs
fengling has quit [Ping timeout: 240 seconds]