<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Probably TOREG(x) would be what you would use in x300 UHD code Marcus.<div>-Ian</div><div><br><div><div>On Apr 14, 2015, at 3:05 AM, Marcus Müller <<a href="mailto:marcus.mueller@ettus.com">marcus.mueller@ettus.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Isen,<br>
    <blockquote type="cite">Thanks. I was aware of the file,
      setting_reg.hpp, and I just did not know what address number I
      should set up. <br>
    </blockquote>
    The address you used for your user settings register.<br>
    <br>
    <blockquote type="cite"><span class="">setting_reg</span>
      #(.my_addr(BASE+2), .width(WIDTH)) reg_tx (.clk(clk),.rst(reset),
      .strobe(set_stb),.addr(set_addr),
      .in(set_data), .out(in_tx),.changed());</blockquote>
    since you set my_addr to BASE+2, you should use the same value when
    poking. (BASE==0 is reserved for user extensions, by the way)<br>
    <br>
    <blockquote type="cite">However, I still have no idea how to access
      this variable from Applications like UHD program.</blockquote>
    You would use the poke32/peek method from
    uhd/host/lib/usrp/cores/radio_ctrl_core_3000.cpp. You can access the
    right instance in x300_impl, so inside x300_impl.cpp, the right
    thing to do is<br>
    <br>
    mb.radio_perifs[0].ctrl->poke32(SR_REG(my_addr), value);<br>
    <br>
    with 0 being the radio control chain A, 1 being B.<br>
    <br>
    Now, if you want to export that functionality, the UHD way of doing
    that is adding an entry to the property tree, and binding a method
    to that; something like:<br>
    <br>
        _tree->create<boost::uint32_t>(mb_path / "custom" /
    "my_register")<br>
            .publish(boost::bind(&radio_ctrl_core_3000::peek32,
    mb.radio_perifs[mb_i].ctrl, SR_REG(BASE,2) ))<br>
            .subscribe(boost::bind(&radio_ctrl_core_3000::poke32,
    mb.radio_perifs[mb_i].ctrl, SR_REG(BASE,2), _1 ));<br>
    <br>
    inside x300_impl::setup_mb.<br>
    <br>
    Other than that, Ian answered a question on a very related topic
    yesterday, see<br>
<a class="moz-txt-link-freetext" href="http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-April/013525.html">http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-April/013525.html</a><br>
    <br>
    @Ian: SR_REG is the right thing to use here, isn't it?<br>
    <br>
    Greetings,<br>
    Marcus<br>
    <br>
    <div class="moz-cite-prefix">On 04/14/2015 11:03 AM, Isen I-Chun
      Chao wrote:<br>
    </div>
    <blockquote cite="mid:CAEG73Ko_qnRLbhr3Yer+m3v6KmkDMroBTDY0a1nEE5fvddyWyw@mail.gmail.com" type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi Marcus, </div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Also, following
          your instruction, I got a piece of code segment below, which
          is from control/gpio_atr:</div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><p class=""><span class="">setting_reg</span>
            #(.my_addr(BASE+2), .width(WIDTH)) reg_tx
            (.clk(clk),.rst(reset), .strobe(set_stb),.addr(set_addr),
            .in(set_data), .out(in_tx),.changed());</p><p class="">However, I still have no idea how to access this
            variable from Applications like UHD program. Is there any
            example code available for us? I know Marcus has been
            dedicated to GNURadio S/W part. But I am sure there are
            someone who is completely familiar with FPGA related
            problems. Could somebody helps? I would very appreciate it.</p><p class=""><br>
          </p><p class=""><br>
          </p>
        </div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr"><font face="arial, helvetica, sans-serif" size="1"><i>Best Regards,<br>
                  Isen I-Chun Chao</i></font></div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Wed, Apr 8, 2015 at 4:32 AM, Marcus
          Müller <span dir="ltr"><<a moz-do-not-send="true" href="mailto:usrp-users@lists.ettus.com" target="_blank">usrp-users@lists.ettus.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Commenting on code
              that I don't know is a bit hard, but:<br>
              <br>
              you will need to have a working instance of setting_reg;
              after that, you'll be able to use the register just like
              the other registers you'd find in your
              uhd/host/lib/usrp/x300/x300_regs.hpp.<br>
              <br>
              Git grep is really helpful finding examples for the usage
              of setting_reg:<br>
              cd fpga/usrp3/lib<br>
              git grep --context 3 setting_reg<br>
              <br>
              Greetings,<br>
              Marcus<span class=""><br>
                <br>
                <div>On 04/05/2015 04:38 AM, Isen I-Chun Chao via
                  USRP-users wrote:<br>
                </div>
              </span>
              <blockquote type="cite">
                <pre>Hi,
I have a customized register in x300_core.v, say named *my_var.* I would
like to get the register value from the application layer through UHD or
whatever.

I wonder if there any example in UHD can be used for my reference or anyone
could provide some advice.
j
Thank you very much.



*Best Regards,Isen I-Chun Chao*

</pre>
                <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
USRP-users mailing list
<a moz-do-not-send="true" href="mailto:USRP-users@lists.ettus.com" target="_blank">USRP-users@lists.ettus.com</a>
<a moz-do-not-send="true" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            USRP-users mailing list<br>
            <a moz-do-not-send="true" href="mailto:USRP-users@lists.ettus.com">USRP-users@lists.ettus.com</a><br>
            <a moz-do-not-send="true" href="http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com" target="_blank">http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></body></html>