aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJonathon Pendlum <jonathon.pendlum@gmail.com>2018-06-22 15:51:08 +0100
committerMartin Braun <martin.braun@ettus.com>2018-06-22 09:10:15 -0700
commitd398fb532e0a0e5be0f3248fb6044d94d3d511f1 (patch)
tree7e9c5d134925b738f898a7159d340edf975c658e /host
parent9c56eb9261b315ab4a29e8ab0a94142c85f21413 (diff)
downloaduhd-d398fb532e0a0e5be0f3248fb6044d94d3d511f1.tar.gz
uhd-d398fb532e0a0e5be0f3248fb6044d94d3d511f1.tar.bz2
uhd-d398fb532e0a0e5be0f3248fb6044d94d3d511f1.zip
RFNoC: Add debug, gain, schmidlcox, and serialdemod block definitions
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/rfnoc/blocks/debug.xml49
-rw-r--r--host/include/uhd/rfnoc/blocks/digital_gain.xml39
-rw-r--r--host/include/uhd/rfnoc/blocks/schmidlcox.xml101
-rw-r--r--host/include/uhd/rfnoc/blocks/serialdemod.xml109
4 files changed, 298 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/blocks/debug.xml b/host/include/uhd/rfnoc/blocks/debug.xml
new file mode 100644
index 000000000..9210b8c2c
--- /dev/null
+++ b/host/include/uhd/rfnoc/blocks/debug.xml
@@ -0,0 +1,49 @@
+<nocblock>
+ <name>Debug</name>
+ <blockname>Debug</blockname>
+ <!--There can be several of these:-->
+ <ids>
+ <id revision="0">DEB1200000000000</id>
+ </ids>
+ <!-- Registers -->
+ <registers>
+ <setreg>
+ <name>CONFIG</name>
+ <address>128</address>
+ </setreg>
+ <setreg>
+ <name>PAYLOAD_SIZE</name>
+ <address>129</address>
+ </setreg>
+ </registers>
+ <!-- Args -->
+ <args>
+ <arg>
+ <name>config</name>
+ <type>int</type>
+ <value>0</value>
+ <action>SR_WRITE("CONFIG", $config)</action>
+ </arg>
+ <arg>
+ <name>spp</name>
+ <type>int</type>
+ <value>64</value>
+ <action>SR_WRITE("PAYLOAD_SIZE", $spp)</action>
+ </arg>
+ </args>
+ <!-- Ports -->
+ <ports>
+ <sink>
+ <name>in</name>
+ <type>sc16</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>sc16</type>
+ </source>
+ <source>
+ <name>stats</name>
+ <type>sc16</type>
+ </source>
+ </ports>
+</nocblock>
diff --git a/host/include/uhd/rfnoc/blocks/digital_gain.xml b/host/include/uhd/rfnoc/blocks/digital_gain.xml
new file mode 100644
index 000000000..8d22dec04
--- /dev/null
+++ b/host/include/uhd/rfnoc/blocks/digital_gain.xml
@@ -0,0 +1,39 @@
+<nocblock>
+ <name>Digital Gain</name>
+ <blockname>DigitalGain</blockname>
+ <!--There can be several of these:-->
+ <ids>
+ <id revision="0">B160</id>
+ </ids>
+ <!-- Registers -->
+ <registers>
+ <setreg>
+ <name>GAIN</name>
+ <address>128</address>
+ </setreg>
+ </registers>
+ <!-- Args -->
+ <args>
+ <arg>
+ <name>gain</name>
+ <type>double</type>
+ <value>1.0</value>
+ <check>GE($gain, 0.0) AND LE($gain, 32767.0)</check>
+ <check_message>Invalid gain.</check_message>
+ <action>
+ SR_WRITE("GAIN", IROUND($gain))
+ </action>
+ </arg>
+ </args>
+ <!-- Ports -->
+ <ports>
+ <sink>
+ <name>in0</name>
+ <type>sc16</type>
+ </sink>
+ <source>
+ <name>out0</name>
+ <type>sc16</type>
+ </source>
+ </ports>
+</nocblock>
diff --git a/host/include/uhd/rfnoc/blocks/schmidlcox.xml b/host/include/uhd/rfnoc/blocks/schmidlcox.xml
new file mode 100644
index 000000000..917b54ba3
--- /dev/null
+++ b/host/include/uhd/rfnoc/blocks/schmidlcox.xml
@@ -0,0 +1,101 @@
+<!--This defines one NoC-Block.-->
+<nocblock>
+ <name>Schmidl &amp; Cox</name>
+ <blockname>SchmidlCox</blockname>
+ <!--There can be several of these:-->
+ <ids>
+ <id revision="0">5CC0</id>
+ </ids>
+ <!-- Registers -->
+ <registers>
+ <setreg>
+ <name>FRAME_LENGTH</name>
+ <address>129</address>
+ </setreg>
+ <setreg>
+ <name>CP_LENGTH</name>
+ <address>130</address>
+ </setreg>
+ <setreg>
+ <name>DELAY</name>
+ <address>131</address>
+ </setreg>
+ <setreg>
+ <name>NUM_SYMBOLS_MAX</name>
+ <address>132</address>
+ </setreg>
+ <setreg>
+ <name>THRESHOLD</name>
+ <address>134</address>
+ </setreg>
+ <setreg>
+ <name>AGC_REF_LEVEL</name>
+ <address>135</address>
+ </setreg>
+ </registers>
+ <!-- Args -->
+ <args>
+ <arg>
+ <name>fftsize</name>
+ <type>int</type>
+ <value>64</value>
+ <!--TODO: Make publisher, when setting this value, check if equal to GET()-->
+ </arg>
+ <arg>
+ <name>frame_len</name>
+ <type>int</type>
+ <value>64</value>
+ <action>SR_WRITE("FRAME_LENGTH", $frame_len)</action>
+ </arg>
+ <arg>
+ <name>cp_len</name>
+ <type>int</type>
+ <value>16</value>
+ <action>SR_WRITE("CP_LENGTH", $cp_len)</action>
+ </arg>
+ <arg>
+ <name>threshold</name>
+ <type>double</type>
+ <value>0.8</value>
+ <check>GE($threshold, 0.0) AND LE($threshold, 1.0)</check>
+ <check_message>Detection threshold must be in [0, 1].</check_message>
+ <action>SR_WRITE("THRESHOLD", IROUND(MULT(16384.0, $threshold)))</action>
+ </arg>
+ <arg>
+ <name>delay</name>
+ <type>int</type>
+ <value>146</value>
+ <check>GE($delay, 0) AND LE($delay, 32767)</check>
+ <check_message>Invalid delay.</check_message>
+ <action>SR_WRITE("DELAY", $delay)</action>
+ </arg>
+ <arg>
+ <name>max_num_symbols</name>
+ <type>int</type>
+ <value>12</value>
+ <check>GE($max_num_symbols, 0) AND LE($max_num_symbols, 1000)</check>
+ <check_message>Invalid number of max symbols.</check_message>
+ <action>SR_WRITE("NUM_SYMBOLS_MAX", $max_num_symbols)</action>
+ </arg>
+ <arg>
+ <name>agc_ref_level</name>
+ <type>double</type>
+ <value>0.125</value>
+ <check>GE($agc_ref_level, 0.0) AND LE($agc_ref_level, 1.0)</check>
+ <check_message>AGC reference level must be in [0, 1].</check_message>
+ <action>SR_WRITE("AGC_REF_LEVEL", IROUND(MULT(32768.0, $agc_ref_level)))</action>
+ </arg>
+ </args>
+ <ports>
+ <sink>
+ <name>in</name>
+ <type>sc16</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>sc16</type>
+ <vlen>$fftsize</vlen>
+ <pkt_size>%vlen</pkt_size>
+ </source>
+ </ports>
+</nocblock>
diff --git a/host/include/uhd/rfnoc/blocks/serialdemod.xml b/host/include/uhd/rfnoc/blocks/serialdemod.xml
new file mode 100644
index 000000000..37f3357c1
--- /dev/null
+++ b/host/include/uhd/rfnoc/blocks/serialdemod.xml
@@ -0,0 +1,109 @@
+<!--This defines one NoC-Block.-->
+<nocblock>
+ <name>OFDM Constellation Demod</name>
+ <blockname>OFDMDemap</blockname>
+ <!--There can be several of these:-->
+ <ids>
+ <id revision="0">0FCD</id>
+ </ids>
+ <!-- Registers -->
+ <registers>
+ <setreg>
+ <name>MOD_ORDER</name>
+ <address>129</address>
+ </setreg>
+ <setreg>
+ <name>SCALING</name>
+ <address>130</address>
+ </setreg>
+ <setreg>
+ <name>OUTPUT_SYMBOLS</name>
+ <address>131</address>
+ </setreg>
+ <setreg>
+ <name>PKT_LEN</name>
+ <address>132</address>
+ </setreg>
+ <setreg>
+ <name>SET_EOB</name>
+ <address>133</address>
+ </setreg>
+ </registers>
+ <!-- Args -->
+ <args>
+ <arg>
+ <name>fftsize</name>
+ <type>int</type>
+ <value>64</value>
+ </arg>
+ <arg>
+ <name>mod_order</name>
+ <type>int</type>
+ <value>4</value>
+ <check>GE($mod_order, 2) AND LE($mod_order, 64) AND IS_PWR_OF_2($mod_order)</check>
+ <check_message>Modulation order must be in (2, 4, 16, 64).</check_message>
+ <action>SR_WRITE("MOD_ORDER", LOG2($mod_order))</action>
+ </arg>
+ <arg>
+ <name>scaling</name>
+ <type>double</type>
+ <value>1.4142135623730951</value>
+ <check>GE($scaling, 0.1) AND LT($scaling, 4.0)</check>
+ <check_message>Invalid scaling.</check_message>
+ <action>SR_WRITE("SCALING", IROUND(MULT(16384.0, $scaling)))</action>
+ </arg>
+ <arg>
+ <name>output_symbols</name>
+ <type>int</type>
+ <value>1</value>
+ <check>EQUAL($output_symbols, 0) OR EQUAL($output_symbols, 1)</check>
+ <check_message>Output symbols can only be true (1) or false (0)</check_message>
+ <action>SR_WRITE("OUTPUT_SYMBOLS", $output_symbols)</action>
+ </arg>
+ <!-- Packet length in bytes -->
+ <arg>
+ <name>pkt_len</name>
+ <type>int</type>
+ <value>64</value>
+ <check>GE($pkt_len, 4) AND LE($pkt_len, 4096)</check>
+ <check_message>Packet length must be greater than or equal to 4 and less than or equal to 4096 bytes</check_message>
+ <action>SR_WRITE("PKT_LEN", $pkt_len)</action>
+ </arg>
+ <arg>
+ <name>set_eob</name>
+ <type>int</type>
+ <value>1</value>
+ <check>EQUAL($set_eob, 0) OR EQUAL($set_eob, 1)</check>
+ <check_message>Set end of burst can only be true (1) or false (0)</check_message>
+ <action>SR_WRITE("SET_EOB", $set_eob)</action>
+ </arg>
+ </args>
+ <ports>
+ <sink>
+ <name>in</name>
+ <type>sc16</type>
+ <vlen>$fftsize</vlen>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>u8</type>
+ </source>
+ </ports>
+ <!--<components>-->
+ <!--<component>-->
+ <!--<key revision="1">nocshell</key>-->
+ <!--</component>-->
+ <!--<component srbase="0">-->
+ <!--[>Will look for a component with this key:<]-->
+ <!--<key revision="1">componentname</key>-->
+ <!--</component>-->
+ <!--</components>-->
+ <!--<connection>-->
+ <!--<source port="0">nocshell</source>-->
+ <!--<sink port="0">componentname</sink>-->
+ <!--</connection>-->
+ <!--<connection>-->
+ <!--<source port="0">componentname</source>-->
+ <!--<sink port="0">nocshell</sink>-->
+ <!--</connection>-->
+</nocblock>