[prev in list] [next in list] [prev in thread] [next in thread]
List: usrp-users
Subject: Re: [USRP-users] Trying to understand multi_usrp::set_command_time
From: Marcus_Müller via USRP-users <usrp-users () lists ! ettus ! com>
Date: 2015-10-29 11:52:51
Message-ID: 56320893.8010502 () ettus ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi Carel,
> 1. This works correctly, but I am wondering how many commands can be
> queued like this?
Generally, infinitely; but at the point the device's internal FIFO is
full, issueing commands will simply take as long as it takes to make
room in that FIFO.
So: how deep is your FIFO?
20. I was too lazy to figure that one out by reading Verilog, so I
measured it empirically (X310, current git), my code [1].
> 2. Do I need the clear_command_time call between the first set_gpio
> and the seconds set_command_time?
No. That's just a convenience function for set_command_time(time_spec_t(0));
> So it seems like somewhere the software gets blocked and waits for the
> command to be executed before it continues.
get_time_now is if I remember correctly amongst the commands that end up
in that queue, as it's just a register read.
Best regards,
Marcus
[1] https://github.com/marcusmueller/timed_cmd_fifo_test
On 29.10.2015 07:20, Carel Combrink via USRP-users wrote:
> Hi,
>
> I am trying to set timed commands using multi_usrp::set_command_time()
> but it is not behaving as I am expecting and the documentation is not
> very clear around this command.
>
> What I want to achieve:
> While transmitting bursts, I want to schedule a GPIO pin to go high
> and then low after a small time.
> Pseudo code:
> set_command_time(timeHigh)
> set_gpio_attr(pin high)
> clear_command_time()
> set_command_time(timeLow)
> clear_command_time)
> set_gpio_attr(pin low)
>
> 1. This works correctly, but I am wondering how many commands can be
> queued like this?
> 2. Do I need the clear_command_time call between the first set_gpio
> and the seconds set_command_time?
>
> Now the part that I do not understand: I added a printout of
> get_time_now() before and after the above code and get the following
> output (code not given since from the output it should be clear):
> Start Time: 1446018188.316676090000000
> High : 1446018193.004600000000000
> Low : 1446018193.004602000000000
> End Time : 1446018193.004602140000000
>
> So it seems like somewhere the software gets blocked and waits for the
> command to be executed before it continues.
>
> So after some investigation and tests I added a timer to the code to
> time the execution of the different commands with the following output:
> Start Time : 1446018640.315072090000000
> T now() 1 (ns): 68523
> High : 1446018645.004600000000000
> Low : 1446018645.004602000000000
> T cmds (ns): 139416
> End Time : 1446018645.004602140000000
> T now() 2 (ns): 4689572696
>
> I first time the get_time_now() command, followed by the time for all
> of the code described above, then time the call to the last
> get_time_now(). From this it seems like the last get_time_now() only
> returns after the time elapsed for the last timed command.
>
> Is this expected, is there a bug or is my test logic wrong?
>
> My code works correctly, but I had to remove a few calls
> to get_time_now().
>
> Device: X310 over GigE
> UHD version: UHD_003.009.000-7-g8adefb1d
> OS: Ubuntu Linux
>
> Regards,
>
>
> _______________________________________________
> USRP-users mailing list
> USRP-users@lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
[Attachment #5 (text/html)]
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Carel,<br>
<blockquote type="cite">1. This works correctly, but I am wondering
how many commands can be queued like this?</blockquote>
Generally, infinitely; but at the point the device's internal FIFO
is full, issueing commands will simply take as long as it takes to
make room in that FIFO.<br>
So: how deep is your FIFO?<br>
20. I was too lazy to figure that one out by reading Verilog, so I
measured it empirically (X310, current git), my code [1].<br>
<blockquote type="cite">2. Do I need the clear_command_time call
between the first set_gpio and the seconds set_command_time?</blockquote>
No. That's just a convenience function for
set_command_time(time_spec_t(0));<br>
<blockquote type="cite">So it seems like somewhere the software gets
blocked and waits for the command to be executed before it
continues. </blockquote>
get_time_now is if I remember correctly amongst the commands that
end up in that queue, as it's just a register read.<br>
<br>
Best regards,<br>
Marcus<br>
<br>
[1] <a class="moz-txt-link-freetext" \
href="https://github.com/marcusmueller/timed_cmd_fifo_test">https://github.com/marcusmueller/timed_cmd_fifo_test</a><br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 29.10.2015 07:20, Carel Combrink via
USRP-users wrote:<br>
</div>
<blockquote
cite="mid:CAAxNqaq--ThoQGuBdFKVJwaH1Gd118ShPXjq0YPwu7R9MWDQqA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>Hi,<br>
<br>
</div>
I am trying to set timed commands using
multi_usrp::set_command_time() but it is not behaving as I am
expecting and the documentation is not very clear around this
command. <br>
<br>
</div>
<div>What I want to achieve:<br>
</div>
<div>While transmitting bursts, I want to schedule a GPIO pin to
go high and then low after a small time. <br>
</div>
<div>Pseudo code: <br>
</div>
<div>set_command_time(timeHigh)<br>
</div>
<div>set_gpio_attr(pin high)<br>
</div>
<div>clear_command_time()<br>
</div>
<div>set_command_time(timeLow)<br>
clear_command_time)<br>
</div>
<div>set_gpio_attr(pin low)<br>
<br>
</div>
<div>1. This works correctly, but I am wondering how many
commands can be queued like this?<br>
</div>
<div>2. Do I need the clear_command_time call between the first
set_gpio and the seconds set_command_time?<br>
<br>
</div>
<div>Now the part that I do not understand: I added a printout
of get_time_now() before and after the above code and get the
following output (code not given since from the output it
should be clear):<br>
</div>
<div><span style="font-family:monospace,monospace">Start Time:
1446018188.316676090000000<br>
High : 1446018193.004600000000000<br>
Low : 1446018193.004602000000000<br>
End Time : 1446018193.004602140000000</span><br>
</div>
<div><br>
</div>
<div>So it seems like somewhere the software gets blocked and
waits for the command to be executed before it continues. <br>
<br>
</div>
<div>So after some investigation and tests I added a timer to
the code to time the execution of the different commands with
the following output:<br>
<span style="font-family:monospace,monospace">Start Time :
1446018640.315072090000000<br>
T now() 1 (ns): 68523<br>
High : 1446018645.004600000000000<br>
Low : 1446018645.004602000000000<br>
T cmds (ns): 139416<br>
End Time : 1446018645.004602140000000<br>
T now() 2 (ns): 4689572696</span><br>
<br>
</div>
<div>I first time the get_time_now() command, followed by the
time for all of the code described above, then time the call
to the last get_time_now(). From this it seems like the last
get_time_now() only returns after the time elapsed for the
last timed command. <br>
<br>
</div>
<div>Is this expected, is there a bug or is my test logic wrong?<br>
</div>
<div><br>
</div>
<div>My code works correctly, but I had to remove a few calls
to get_time_now(). </div>
<div><br>
Device: X310 over GigE<br>
UHD version: UHD_003.009.000-7-g8adefb1d<br>
</div>
OS: Ubuntu Linux<br>
<div><br>
</div>
<div>Regards,</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
USRP-users mailing list
<a class="moz-txt-link-abbreviated" \
href="mailto:USRP-users@lists.ettus.com">USRP-users@lists.ettus.com</a> <a \
class="moz-txt-link-freetext" \
href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a>
</pre>
</blockquote>
<br>
</body>
</html>
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic