diff options
author | Trung Tran <trung.tran@ettus.com> | 2018-06-28 15:07:58 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-06-29 14:20:44 -0700 |
commit | f5119fb5f0103dfb4bd9871915c44dd855a08b91 (patch) | |
tree | c9fd0804c3256daf0e2b3a0db490f23cf2067d4d | |
parent | 8f16f05b20efcc9e5371c89585b992b237b43eb3 (diff) | |
download | uhd-f5119fb5f0103dfb4bd9871915c44dd855a08b91.tar.gz uhd-f5119fb5f0103dfb4bd9871915c44dd855a08b91.tar.bz2 uhd-f5119fb5f0103dfb4bd9871915c44dd855a08b91.zip |
rfnoc: Merge block controller header files from rfnoc-devel
-rw-r--r-- | host/include/uhd/rfnoc/CMakeLists.txt | 4 | ||||
-rw-r--r-- | host/include/uhd/rfnoc/blocks/fft.xml | 81 | ||||
-rw-r--r-- | host/include/uhd/rfnoc/blocks/fosphor.xml | 82 |
3 files changed, 123 insertions, 44 deletions
diff --git a/host/include/uhd/rfnoc/CMakeLists.txt b/host/include/uhd/rfnoc/CMakeLists.txt index 6ed9fd3c3..44d0490f4 100644 --- a/host/include/uhd/rfnoc/CMakeLists.txt +++ b/host/include/uhd/rfnoc/CMakeLists.txt @@ -28,7 +28,11 @@ IF(ENABLE_RFNOC) # Block controllers ddc_block_ctrl.hpp duc_block_ctrl.hpp + fir_block_ctrl.hpp + null_block_ctrl.hpp radio_ctrl.hpp + siggen_block_ctrl.hpp + window_block_ctrl.hpp DESTINATION ${INCLUDE_DIR}/uhd/rfnoc COMPONENT headers ) diff --git a/host/include/uhd/rfnoc/blocks/fft.xml b/host/include/uhd/rfnoc/blocks/fft.xml index 7dd2eff46..af51d0ddb 100644 --- a/host/include/uhd/rfnoc/blocks/fft.xml +++ b/host/include/uhd/rfnoc/blocks/fft.xml @@ -21,6 +21,18 @@ <name>MAGNITUDE_OUT</name> <address>133</address> </setreg> + <setreg> + <name>FFT_DIRECTION</name> + <address>134</address> + </setreg> + <setreg> + <name>FFT_SCALING</name> + <address>135</address> + </setreg> + <setreg> + <name>FFT_SHIFT_CONFIG</name> + <address>136</address> + </setreg> <readback> <name>RB_FFT_RESET</name> <address>0</address> @@ -29,26 +41,62 @@ <name>RB_MAGNITUDE_OUT</name> <address>1</address> </readback> + <readback> + <name>RB_FFT_SIZE_LOG2</name> + <address>2</address> + </readback> + <readback> + <name>RB_FFT_DIRECTION</name> + <address>3</address> + </readback> + <readback> + <name>RB_FFT_SCALING</name> + <address>4</address> + </readback> + <readback> + <name>RB_FFT_SHIFT_CONFIG</name> + <address>5</address> + </readback> </registers> <!-- Args --> <args> <arg> - <!--This controls only the fft shift part, so remember to also set the ctrl_word--> <name>spp</name> <type>int</type> <value>256</value> <check>GE($spp, 16) AND LE($spp, 4096) AND IS_PWR_OF_2($spp)</check> <check_message>FFT size must be in [16, 4096] and a power of two.</check_message> - <action>SR_WRITE("FFT_SIZE_LOG2", LOG2($spp)) AND SR_WRITE("AXIS_CONFIG_BUS", ADD(873472, LOG2($spp)))</action> + <action>SR_WRITE("FFT_SIZE_LOG2", LOG2($spp))</action> + </arg> + <arg> + <name>shift</name> + <type>string</type> + <value>normal</value> + <check>EQUAL($shift, "normal") OR EQUAL($shift, "reverse") OR EQUAL($shift, "natural")</check> + <check_message>FFT direction must be either "normal", "reverse", or "natural".</check_message> + <action> + IF(EQUAL($shift, "normal"), SR_WRITE("FFT_SHIFT_CONFIG", 0)) OR + IF(EQUAL($shift, "reverse"), SR_WRITE("FFT_SHIFT_CONFIG", 1)) OR + IF(EQUAL($shift, "natural"), SR_WRITE("FFT_SHIFT_CONFIG", 2)) + </action> </arg> <arg> - <name>ctrl_word</name> + <name>direction</name> + <type>string</type> + <value>forward</value> + <check>EQUAL($direction, "forward") OR EQUAL($direction, "reverse")</check> + <check_message>FFT direction must be either "forward" or "reverse".</check_message> + <action> + IF(EQUAL($direction, "forward"), SR_WRITE("FFT_DIRECTION", 1)) OR + IF(EQUAL($direction, "reverse"), SR_WRITE("FFT_DIRECTION", 0)) + </action> + </arg> + <arg> + <name>scaling</name> <type>int</type> - <value>873472</value> - <!--<check>EQUAL($otype, "sc16")</check>--> - <!--<check_message>Output data type must be sc16.</check_message>--> - <!--TODO: Check against mag-out value (requires GET() function) --> - <action>SR_WRITE("AXIS_CONFIG_BUS", ADD($ctrl_word, LOG2($spp)))</action> + <!--scaling per radix-4 butterfly--> + <value>1706</value> + <action>SR_WRITE("FFT_SCALING", $scaling)</action> </arg> <arg> <name>otype</name> @@ -96,21 +144,4 @@ <pkt_size>%vlen</pkt_size> </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> diff --git a/host/include/uhd/rfnoc/blocks/fosphor.xml b/host/include/uhd/rfnoc/blocks/fosphor.xml index 762b7c1bd..b1db73192 100644 --- a/host/include/uhd/rfnoc/blocks/fosphor.xml +++ b/host/include/uhd/rfnoc/blocks/fosphor.xml @@ -9,40 +9,52 @@ <!-- Registers --> <registers> <setreg> + <name>ENABLE</name> + <address>160</address> + </setreg> + <setreg> + <name>CLEAR</name> + <address>161</address> + </setreg> + <setreg> + <name>RANDOM</name> + <address>162</address> + </setreg> + <setreg> <name>DECIM</name> - <address>129</address> + <address>168</address> </setreg> <setreg> <name>OFFSET</name> - <address>130</address> + <address>170</address> </setreg> <setreg> <name>SCALE</name> - <address>131</address> + <address>171</address> </setreg> <setreg> <name>TRISE</name> - <address>132</address> + <address>172</address> </setreg> <setreg> <name>TDECAY</name> - <address>133</address> + <address>173</address> </setreg> <setreg> <name>ALPHA</name> - <address>134</address> + <address>174</address> </setreg> <setreg> <name>EPSILON</name> - <address>135</address> + <address>175</address> </setreg> <setreg> - <name>RANDOM</name> - <address>136</address> + <name>WF_CTRL</name> + <address>176</address> </setreg> <setreg> - <name>CLEAR</name> - <address>137</address> + <name>WF_DECIM</name> + <address>177</address> </setreg> </registers> <!-- Args --> @@ -53,6 +65,27 @@ <value>1024</value> </arg> <arg> + <name>enable</name> + <type>int</type> + <value>3</value> + <check>GE($enable, 0) AND LE($enable, 3)</check> + <check_message>"fosphor enable value must be within [0, 3]"</check_message> + <action>SR_WRITE("ENABLE", $enable)</action> + </arg> + <arg> + <name>clear</name> + <type>int</type> + <action>IF(NOT(EQUAL($clear, 0)), SR_WRITE("CLEAR", $clear))</action> + </arg> + <arg> + <name>random</name> + <type>int</type> + <value>3</value> + <check>GE($random, 0) AND LE($random, 3)</check> + <check_message>"fosphor random mode value must be within [0, 3]"</check_message> + <action>SR_WRITE("RANDOM", $random)</action> + </arg> + <arg> <name>decim</name> <type>int</type> <value>2</value> @@ -109,17 +142,20 @@ <action>SR_WRITE("EPSILON", $epsilon)</action> </arg> <arg> - <name>random</name> + <name>wf_ctrl</name> <type>int</type> - <value>1</value> - <check>GE($random, 0) AND LE($random, 3)</check> - <check_message>"fosphor random value must be within [0, 65535]"</check_message> - <action>SR_WRITE("RANDOM", $random)</action> + <value>0</value> + <check>GE($wf_ctrl, 0) AND LE($enable, 255)</check> + <check_message>"fosphor wf_ctrl value must be within [0, 255]"</check_message> + <action>SR_WRITE("WF_CTRL", $wf_ctrl)</action> </arg> <arg> - <name>clear</name> + <name>wf_decim</name> <type>int</type> - <action>IF(NOT(EQUAL($clear, 0)), SR_WRITE("CLEAR", $clear))</action> + <value>8</value> + <check>GE($wf_decim, 2) AND LE($wf_decim, 256)</check> + <check_message>fosphor wf_decim constant must be within [2, 256]</check_message> + <action>SR_WRITE("WF_DECIM", ADD($wf_decim, -2))</action> </arg> </args> <!--All the connections to the outside world are listed in 'ports':--> @@ -131,10 +167,18 @@ <pkt_size>%vlen</pkt_size> </sink> <source> - <name>out</name> + <name>out_hist</name> + <type>u8</type> + <vlen>$spp</vlen> + <pkt_size>%vlen</pkt_size> + <port>0</port> + </source> + <source> + <name>out_wf</name> <type>u8</type> <vlen>$spp</vlen> <pkt_size>%vlen</pkt_size> + <port>1</port> </source> </ports> <!--<components>--> |