User Tools

Site Tools


tuto_fpga_pico

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tuto_fpga_pico [2016/12/14 18:44] – [Edit the .grc file] onicolastuto_fpga_pico [2017/11/15 16:22] (current) – [Create the scenario] onicolas
Line 20: Line 20:
  
  
-Let's back to the idea of sending a constant number to the PicoSDR and see if we get it back. First thing to do is to add a ''Constant Source'' block (with Int as Output Type, and whatever-you-want as the constant) (block can be found in category ''Waveform Generator''), and connect it to ''RTDEX Sink''. Now, how can we check that we receive the right number ? We could send it to a file and then check the file, but this ain't funny. Instead of this, we're gonna use a super cool new type of block added to GNURadio lately (As I am writing this tutorial). I'm talking about ''Python Block''. With this block, you can create a custom block, with its associated python code easily, without going through an OOT module. +Let'get back to the idea of sending a constant number to the PicoSDR and see if we get it back. First thing to do is to add a ''Constant Source'' block (with Int as Output Type, and whatever-you-want as the constant) (block can be found in category ''Waveform Generator''), and connect it to ''RTDEX Sink''. Now, how can we check that we receive the right number ? We could send it to a file and then check the file, but this ain't funny. Instead of this, we're gonna use a super cool new type of block added to GNURadio lately (As I am writing this tutorial). I'm talking about ''Python Block''. With this block, you can create a custom block, with its associated python code easily, without going through an OOT module. 
  
 Add a Python Block (from category ''Misc''), open it, and click on 'Open in Editor'. You can now edit the python code behind the block, and as soon as you save it, changes are repercuted to the block in GRC. You can either write your own code comparing two inputs or use mine : Add a Python Block (from category ''Misc''), open it, and click on 'Open in Editor'. You can now edit the python code behind the block, and as soon as you save it, changes are repercuted to the block in GRC. You can either write your own code comparing two inputs or use mine :
Line 27: Line 27:
 Embedded Python Blocks: Embedded Python Blocks:
  
-Each this file is saved, GRC will instantiate the first class it finds to get +Each time this file is saved, GRC will instantiate the first class it finds to get 
-ports and parameters of your block. The arguments to __init__  will be the+the ports and parameters of your block. The arguments to __init__  will be the
 parameters. All of them are required to have default values! parameters. All of them are required to have default values!
 """ """
Line 83: Line 83:
 ## Create the scenario ## Create the scenario
  
-In order to run the experiment in CorteXlab we need a description called scenario. Create a file named ''scenario.desc'' and copy the following in it :+In order to run the experiment in CorteXlab we need a description called scenario. Create a file named ''scenario.yaml'' and copy the following in it :
 <code> <code>
 # Example scenario description file # Example scenario description file
Line 92: Line 92:
 # Scenario textual description # Scenario textual description
 #   simple string (a one liner) #   simple string (a one liner)
-desc base scenario for CorteXlab+description: base scenario for CorteXlab
  
 # Experiment maximum duration # Experiment maximum duration
 #   Time after which the experiment is forced to stop #   Time after which the experiment is forced to stop
-#   integer (minutes+#   integer (seconds
-durat 5+duration: 300
  
 # Node list # Node list
Line 103: Line 103:
 #   format: #   format:
 # #
-#   (machine): +#   nodes: 
-  entry (entry point script relative to the task root+#     (machine): 
-#   exit (exit point script relative to the task root. Use "none" for none)+      command: (entry point script relative to the task root)
  
-node31: +nodes: 
-   entry ofdm.py +  node31: 
-   bitstreamA OFDM_6_6_0_sx315.bit+    command: ./ofdm.py 
 +    bitstreamAOFDM_6_6_0_sx315.bit
 </code> </code>
  
-If you trasnlate this file it says "The experiment will run for 5 minutes. The script ofdm.py will be executed on node 31 using the bitstream OFDM_6_6_0_sx315.bit".+If you translate this file it says "The experiment will run for 5 minutes. The script ofdm.py will be executed on node 31 using the bitstream OFDM_6_6_0_sx315.bit".
  
  
Line 123: Line 124:
 │   ├── ofdm.py │   ├── ofdm.py
 │   ├── epy_block_0.py │   ├── epy_block_0.py
-│   ├── scenario.desc+│   ├── scenario.yaml
 │   ├── ofdm.grc │   ├── ofdm.grc
 │   └── OFDM_6_6_0_sx315.bit │   └── OFDM_6_6_0_sx315.bit
Line 218: Line 219:
 you@srvairlock:~/results/task_15/node31$ ls you@srvairlock:~/results/task_15/node31$ ls
 epy_block_0.py    impact_instr.txt      ofdm.py        stdout.txt epy_block_0.py    impact_instr.txt      ofdm.py        stdout.txt
-epy_block_0.pyc   OFDM_6_6_0_sx315.bit  scenario.desc+epy_block_0.pyc   OFDM_6_6_0_sx315.bit  scenario.yaml
 _impactbatch.log  ofdm.grc              stderr.txt _impactbatch.log  ofdm.grc              stderr.txt
 </code> </code>
  
-We see that all of the files we used to create the task are inside. The other two are:+We see that all of the files we used to create the task are inside. The others are:
  
   * ''stdout.txt'': all output messages from your GNU Radio python script are written here. These include GNU Radio messages as well as all "print"s you include in your code. Seeing the contents of this file is useful to assert its correct operation.   * ''stdout.txt'': all output messages from your GNU Radio python script are written here. These include GNU Radio messages as well as all "print"s you include in your code. Seeing the contents of this file is useful to assert its correct operation.
   * ''stderr.txt'': all error messages are printed here. If you see strange things on the ''stdout.txt'' or nothing at all, it might be interesting to take a look at the ''stderr.txt'' to debug your code.   * ''stderr.txt'': all error messages are printed here. If you see strange things on the ''stdout.txt'' or nothing at all, it might be interesting to take a look at the ''stderr.txt'' to debug your code.
-  * ''impact_instr.txt'': The impact instructions used to flash the bitstream +  * ''impact_instr.txt'': The impact instructions used to flash the bitstream (this file is automatically generated) 
-  * ''_impactbatch.log'': Impact log+  * ''_impactbatch.log'': Impact execution log
  
 Let's take a look inside ''stdout.txt'': Let's take a look inside ''stdout.txt'':
tuto_fpga_pico.1481737480.txt.gz · Last modified: 2016/12/14 18:44 by onicolas

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki