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
<GitHub144> [artiq] whitequark pushed 1 new commit to master: https://git.io/viRBJ
<GitHub144> artiq/master b100770 whitequark: runtime: expose strlen (implicitly required for comparing strings)....
<bb-m-labs> build #28 of artiq-board is complete: Success [build successful] Build details are at http://buildbot.m-labs.hk/builders/artiq-board/builds/28
<bb-m-labs> build #938 of artiq is complete: Failure [failed] Build details are at http://buildbot.m-labs.hk/builders/artiq/builds/938 blamelist: whitequark <whitequark@whitequark.org>
fengling has joined #m-labs
<GitHub192> [artiq] sbourdeauducq pushed 1 new commit to release-2: https://git.io/viRu2
<GitHub192> artiq/release-2 b73d7e4 whitequark: runtime: expose strlen (implicitly required for comparing strings)....
<sb0> larsc, I think this is may be unnecessary, you can take out the clocks from transceivers into the fabric without problems. the only thing I see is problems with sampling sysref, as there may be issues with jitter or divider. the JESD logic should be insensitive to that. how does one need to sample sysref, and where did you read about the 6.6Gbps limit?
<sb0> ah should have scrolled down.
digshadow has joined #m-labs
na_ has joined #m-labs
_whitelogger has joined #m-labs
Gurty has quit [*.net *.split]
cr1901_modern has quit [*.net *.split]
rjo has quit [*.net *.split]
cyrozap has quit [*.net *.split]
awallin____ has quit [*.net *.split]
larsc has quit [*.net *.split]
acathla has quit [*.net *.split]
stigo has quit [*.net *.split]
mithro has quit [*.net *.split]
ChanServ has quit [*.net *.split]
fengling has quit [*.net *.split]
na_ has quit [*.net *.split]
bentley` has quit [*.net *.split]
siruf has quit [*.net *.split]
xcombelle has quit [*.net *.split]
sb0 has quit [*.net *.split]
swivel has quit [*.net *.split]
tmbinc__ has quit [*.net *.split]
kuldeep has quit [*.net *.split]
bb-m-labs has quit [*.net *.split]
jaeckel has quit [*.net *.split]
MiW has quit [*.net *.split]
stekern has quit [*.net *.split]
early has quit [*.net *.split]
zoobab_ has quit [*.net *.split]
kristianpaul has quit [*.net *.split]
gric has quit [*.net *.split]
sandeepkr__ has quit [*.net *.split]
[florian] has quit [*.net *.split]
digshadow has quit [*.net *.split]
kyak has quit [*.net *.split]
kaaliakahn has quit [*.net *.split]
whitequark has quit [*.net *.split]
hozer has quit [*.net *.split]
attie has quit [*.net *.split]
Neuron1k has quit [*.net *.split]
ysionneau has quit [*.net *.split]
_whitelogger has joined #m-labs
_whitelogger has quit [Excess Flood]
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
_whitelogger has joined #m-labs
awallin____ has joined #m-labs
stigo has joined #m-labs
acathla has joined #m-labs
<larsc> but have a look at this http://metafoo.de/jesd_sysref.png
<larsc> each device gets their own sysref to make sure that devices with different clocks still see the sysref edge at the same point in time
<larsc> clock A in this diagram would be the DAC clock, clock B the deviceclock for the FPGA
<sb0> I see. looks complicated/requiring additional chips.
<sb0> at lanerate/40, the FPGA clock is 300MHz. are the IOBs and clocks so bad that you can't sample reliably if you went through IBUFDS_GTE2?
<sb0> what chip do you use to generate signals like this?
<larsc> ad9523, ad9528 or hmc7044 depending on the system needs
<larsc> ad9528 is a bit like a ad9523 but with more advanced features like a programable delay line on each output
<larsc> hmc7044 can go up to 3G
<larsc> while the other two are limited to 1.25G
<larsc> on a kintex7 there is a 1.6ns difference from the IBUFDS_GTE2 to th BUFG between the setup and hold paths
<sb0> but how much does that difference vary?
<sb0> and I'm not sure if I understood what you said. did you mean it takes 1.6ns to go from IBUFDS_GTE2 to BUFG?
<larsc> the min and max differ by 1.6ns over process, temperature, etc.
<larsc> but if you use a BUFH it is actually only 0.1ns
<larsc> so much better
<larsc> with a bufh you can probably do 300M
<larsc> http://pastebin.com/rx2SyQsr this meets timing
<larsc> with a total slack of 50ps
<larsc> hm, this was actually with assuming virtex7 speedgrade 1 timing
Gurty has joined #m-labs
<larsc> using a IBUFDS instead of a IBUFDS_GTE2 increases the total slack to a full 1ns
<larsc> with a bufr instead of a bufh 1.3ns slack
rohitksingh has joined #m-labs
<larsc> on a kintex7 speedgrade 2 the timing margins are similar for all cases, maybe 0.1ns-0.2ns better
rohitksingh has quit [Quit: Leaving.]
<sb0> whitequark, how do you deal with the rust borrow system in this case? http://hastebin.com/emabaqadaf.py
<sb0> what I want eventually is send what is received on one connection to all connections
<whitequark> sb0: so the most important thing to understand about rust memory management is the concept of ownership
<whitequark> for an unadorned thing (i.e. without Rc<>, Arc<>, or other similar sharing mechanism) there is exactly one place it is stored, and that place is responsible for destroying it
<whitequark> when you want to do something with a thing stored there, you have two options
<whitequark> first, you can borrow it, and second, you can take it out (i.e. move)
<whitequark> in this case, you want the LinkedList to keep storing the connections (presumably) and so you want to borrow it
rohitksingh has joined #m-labs
<whitequark> the way you can borrow every item in a LinkedList sequentially is by doing for conn in list.iter() { ... }
<whitequark> ... or in this case, .iter_mut(), since reading or writing from a connection requires exclusive access.
<whitequark> the &mut pointer is somewhat of a misnomer. it says "mutable" but what it really means is "exclusive"
<sb0> yes, I read that in the doc
<whitequark> ok
<sb0> but now I have the problem that I do want the same object in two places: the linked list so I can broadcast, and where the connection is accepted so I can read what to broadcast
<whitequark> are you trying to make something like an ethernet hub (but for TCP connections) ?
<sb0> yes
<whitequark> ahh
<sb0> no practical use, just trying out rust
<whitequark> so in std::io::TcpStream, you have a .clone()
<whitequark> this gives you another view into the same file descriptor, essentially
<whitequark> this doesn't exist with the io scheduler I wrote since it simply lacks that layer of indirection
<whitequark> I've considered adding it but decided to save time and do without, since it's not really necessary for any of the code I'll need to port
<whitequark> anyway, you can work around that, one sec
<whitequark> sb0: put the TcpStream into an Rc<RefCell<...>>
<whitequark> then you could do something like... rc_conn.borrow().write(b"jjj")
<whitequark> borrow_mut() rather
<sb0> I'm running on linux for now
<whitequark> ah, then just clone()
<sb0> let me try clone()
<sb0> do we have linkedlists and the other things in the standard library on the device?
<whitequark> yes, you have all of the collections
<whitequark> you don't have anything in std::sync or std::io
<sb0> hm, i'm using mioco and it doesn't have clone()
<whitequark> no idea what to do with mioco
<whitequark> I haven't really found mio necessary so far. there's a reason Rust dropped green threads from the core language, too
<sb0> does this have anything to do with the problem I have right now?
<whitequark> 4no
<whitequark> *no
<sb0> with Rc<RefCell< I get:
<sb0> src/main.rs:24:15: 24:27 error: the trait bound `std::rc::Rc<std::cell::RefCell<mioco::MioAdapter<mio::net::tcp::TcpStream>>>: std::marker::Send` is not satisfied [E0277]
<sb0> src/main.rs:24 mioco::spawn(move || -> io::Result<()> {
<sb0> mioco != mio
<whitequark> hm
<whitequark> so the error above essentially says that Rc cannot be shared between threads (since it's not threadsafe)
<whitequark> Arc is
<sb0> anyway, try_clone seems to work
<sb0> ok, but this is supposed to be a coroutine
<whitequark> sure
<whitequark> that's still a concurrency primitive
<whitequark> sb0: there are multiple reasons, but I think the main one is that mioco explicitly lets you use multiple thread for dispatch
<whitequark> i.e. the same number of threads as the number of cores
<sb0> hm, now I can't use the linked list in the coroutine
<whitequark> yes. you need to put that into Arc<Mutex<...>>
<sb0> which makes senses if it were a thread, but now it's simply annoying
<whitequark> it has the same problems as threads...
<sb0> how do I iterate on a mutex-protected linked list?
rohitksingh has quit [Ping timeout: 244 seconds]
<sb0> for conn2 in connections.lock().unwrap() results in
<sb0> src/main.rs:28:21: 30:22 error: the trait bound `std::sync::MutexGuard<'_, std::collections::LinkedList<mioco::MioAdapter<mio::net::tcp::TcpStream>>>: std::iter::Iterator` is not satisfied [E0277]
<whitequark> .unwrap().iter()
<whitequark> MutexGuard dereferences to its contents, so it acts much like a &mut LinkedList would
<sb0> back to the original error I had before any arc/mutex stuff. it refuses to move the Arc<Mutex<LinkedList>>> into the closure just like it refused to move LinkedList
<whitequark> yes
<whitequark> but now you can clone the Arc
<whitequark> leave one copy where it is, move the other
<whitequark> this results in a mildly annoying scoping tricks, like this https://github.com/whitequark/rust-vnc/blob/master/src/client.rs#L280-L289
<sb0> okay, now it refuses to let me call write_all() on the list elements, because that would mutate them
<sb0> "cannot borrow immutable borrowed content `*conn2` as mutable"
<whitequark> sure, .iter_mut()
<whitequark> unfortunately rust doesn't let you abstract over mutability; adding muts everywhere is one of the more annoying parts of it
<sb0> phew, finally it compiled
<sb0> works
<whitequark> I was pretty frustrated for the first few weeks
<sb0> thanks!
<whitequark> but you get used to it
digshadow has joined #m-labs
bentley` has joined #m-labs
digshadow has quit [Ping timeout: 260 seconds]
digshadow has joined #m-labs