<GitHub>
[artiq] whitequark commented on commit bc3fc26: @jordens I really don't think we should expose mtspr/mfspr in ARTIQ Python. First, that breaks memory safety (and I think we don't currently have any way to do it otherwise). Second, the firmware and the gateware agree on the interface and go hand-in-hand, whereas the ARTIQ Python code is generally oblivious of all platform details. https://github.com/m-labs/artiq/commit/bc3fc26e3489722d2313aa777c
<sb0>
typical xilinx engineering. instead of fixing the problem in the first place (add_files is slow) they add a "critical warning" and an answer record
<sb0>
also note the language: "performance intensive" and not "slow".
<whitequark>
e.g. if a load and a dcache miss happen at the same time the pccr will only get incremented once
<rjo>
whitequark: yes. see my issue about that.
<whitequark>
oh right.
<whitequark>
how'd you even fix that?
<whitequark>
without creating some massive adder tree or something?
<rjo>
whitequark: pccr += count_bits_set(...) in gateware. might be costly.
<whitequark>
I don't like this bitset design for PCMR
<rjo>
pccr += count_bits_set(events & mask)
<whitequark>
wonder if you could just have a counter per mask bit.
<whitequark>
and have it cheaper
<rjo>
whitequark: that's the workaround. yes.
<whitequark>
well for now there are fewer counters than bits.
<whitequark>
so it's not fully general
<whitequark>
but I guess you could just document this as well.
<rjo>
whitequark: yep.
<rjo>
whitequark: also, when i played with it for a few minutes, the numbers didn't make sense to me. i.e. they only increase significantly when i do RPCs (kernel-to-host). but i didn't dig very deep.
<whitequark>
we may want to make "syscalls" real syscalls.
<whitequark>
so that we can set the CIUM bit.
<rjo>
whitequark: absolutely.
<whitequark>
ok.
<whitequark>
what's your opinion on my proposed interface?
<rjo>
whitequark: do you want to do that? i guess you might be most interested in using the PCU when tweaking the compiler. i am not certain what you'd want the API to look like there exactly.
<whitequark>
oh right, you check for "counter not present"
<whitequark>
I missed that
<whitequark>
hm, and that mangled log isn't even because of UART, the entries are actually like that
<whitequark>
wtf
<whitequark>
I bet it's some binutils issue again
<cr1901_modern>
*reads o1rk manual section on perfcount* Looks like more than just load/dcache miss at the same time can cause PCCRs to increment more than once? Implementing that seems really ugly/not well thought out :o
<sb0>
whitequark, where should I use 'features = ["alloc"]' when depending on std_artiq in Cargo.toml?