<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pct.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hbi009</id>
	<title>pCT - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://pct.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hbi009"/>
	<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/Special:Contributions/Hbi009"/>
	<updated>2026-05-25T04:26:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://pct.wiki.uib.no/index.php?title=Using_IPbus&amp;diff=952</id>
		<title>Using IPbus</title>
		<link rel="alternate" type="text/html" href="https://pct.wiki.uib.no/index.php?title=Using_IPbus&amp;diff=952"/>
		<updated>2021-09-24T14:22:00Z</updated>

		<summary type="html">&lt;p&gt;Hbi009: /* Adding paths to envirorment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Main Page]] -&amp;gt; [[Control &amp;amp; Readout Software Documentation and Howto&#039;s]] -&amp;gt; [[Using IPbus]]&lt;br /&gt;
&lt;br /&gt;
== Use case ==&lt;br /&gt;
IPbus is a control protocol that uses UDP/IP to send values into the registers on the readout unit (RU). The software on the host computer uses the Hardware Access Library (uHAL) to send the commands to the RU. &lt;br /&gt;
[[File:ipbus-conect6.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration files ==&lt;br /&gt;
There is a main connection file (pRU-connections.xml), this file contains the address and port of the RU, for information on the content of the connection file please see the [[:Media:PRU Ethernet Configurations.pdf | pRU Ethernet Configurations]] document.&lt;br /&gt;
&lt;br /&gt;
Following there is a Module registers file (module-address.xml), this file contains a table with all the registers present in the RU.&lt;br /&gt;
&lt;br /&gt;
Finally, there are files for each register&lt;br /&gt;
* global_regs.xml&lt;br /&gt;
* trigger_manager.xml&lt;br /&gt;
* offload.xml&lt;br /&gt;
* alpide_control.xml&lt;br /&gt;
* alpide_data.xml&lt;br /&gt;
&lt;br /&gt;
As of the writing of this page, these files can be found on the production_test repository in the ipbus branch under the BSP folder.&lt;br /&gt;
&lt;br /&gt;
WARNING: To prevent undefined behavior the register files MUST match the firmware version!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Smart Dummy Hardware ==&lt;br /&gt;
To be able to read values from registers, a custom DummyHardwareUdp.exe can be built from this repository:&lt;br /&gt;
[https://github.com/norscope/ipbus-software/tree/smartdummy IPbus Custom Repo]&lt;br /&gt;
NOTE: Remember to switch to the smartdummy branch.&lt;br /&gt;
&lt;br /&gt;
This adds a file reader in the DummyHardware.cpp that reads a file in the directory of the executable, the file is called register-values.txt, an example file can be found here: [[:Media:register-values.txt | Example file]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How to Build on Ubuntu 20.04 LTS ===&lt;br /&gt;
==== Requierd packages ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo apt update&lt;br /&gt;
$ sudo apt install git g++ make erlang python3 python-is-python3 libboost1.71-all-dev libpugixml-dev&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== Building ==== &lt;br /&gt;
In the directory where the repository have been downloaded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ sudo make install prefix=/home/user/ipbus-install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== Adding paths to envirorment ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ export LD_LIBRARY_PATH=/home/user/ipbus-install/lib:$LD_LIBRARY_PATH&lt;br /&gt;
$ export PYTHONPATH=/home/user/ipbus-install/lib/python3.8/site-packages:$PYTHONPATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Running the hardware emulator ==== &lt;br /&gt;
Change directory to ipbus-install/bin/uhal/tests&lt;br /&gt;
NOTE: Make sure the register-values.txt file is present in this folder. Filename is in all lowercase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./DummyHardwareUdp.exe -p 50001 -v 2 -V&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Testing the emulator ====&lt;br /&gt;
From the production_test repo, in the folder tests_vcu118 run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ python test_ipbus_emulator.py &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should output 0xfeedbeef&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additonal information ==&lt;br /&gt;
For more information, please consult the IPbus wiki at: [https://ipbus.web.cern.ch/ipbus/doc/user/html/software/uhalQuickTutorial.html IPbus wiki]&lt;/div&gt;</summary>
		<author><name>Hbi009</name></author>
	</entry>
</feed>