{"id":22753936,"url":"https://github.com/slaclab/rfsoc-4x2-photon-detector-dev","last_synced_at":"2025-03-30T07:23:18.949Z","repository":{"id":155561419,"uuid":"632199727","full_name":"slaclab/rfsoc-4x2-photon-detector-dev","owner":"slaclab","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-09T05:56:55.000Z","size":1768,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-02-05T09:42:12.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slaclab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-24T23:23:30.000Z","updated_at":"2024-07-15T07:22:03.000Z","dependencies_parsed_at":"2023-12-19T01:18:18.024Z","dependency_job_id":"f2e00fa8-7676-4afa-b393-1e0ebca90619","html_url":"https://github.com/slaclab/rfsoc-4x2-photon-detector-dev","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaclab%2Frfsoc-4x2-photon-detector-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaclab%2Frfsoc-4x2-photon-detector-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaclab%2Frfsoc-4x2-photon-detector-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slaclab%2Frfsoc-4x2-photon-detector-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slaclab","download_url":"https://codeload.github.com/slaclab/rfsoc-4x2-photon-detector-dev/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246287454,"owners_count":20753251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T06:14:37.490Z","updated_at":"2025-03-30T07:23:18.746Z","avatar_url":"https://github.com/slaclab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rfsoc-4x2-photon-detector-dev\n\nThis project is an example of emulating the SiPM signal using a RFSOC DAC and reading it back from the RFSoC ADC.\nThe DAC[A] output is loopbacked to the ADC[A].\nThe DAC is operating at 8.128 GSample/s, and the ADC is operating at 2.032 GSample/s.\n\nOnly ADC[A] and DAC[A] is implemented in the firmware.  ADC[B,C,D] and DAC[B] are unused.\n\nHere's the URL to the RFSoC 4x2 hardware:\nhttp://dev.realdigital.org/hardware/rfsoc-4x2\n\nDue to the 10MHz low frequency roll off of the balums on the RFSoC 4x2, we removed them\nand installed a differential twinax cable for the loopback to decrease the low frequnecy \ncutoff as low as reasonably possible. \n\n\u003cimg src=\"docs/images/LoopbackRework.jpg\" width=\"200\"\u003e\n\n\u003c!--- ######################################################## --\u003e\n\n# Before you clone the GIT repository\n\nhttps://confluence.slac.stanford.edu/x/vJmDFg\n\n\u003c!--- ######################################################## --\u003e\n\n# Clone the GIT repository\n\n```bash\n$ git clone --recursive git@github.com:slaclab/rfsoc-4x2-photon-detector-dev\n```\n\n\u003c!--- ######################################################## --\u003e\n\n# How to generate the RFSoC .BIT and .XSA files\n\n1) Setup Xilinx PATH and licensing (if on SLAC AFS network) else requires Vivado install and licensing on your local machine\n\n```bash\n$ source rfsoc-4x2-photon-detector-dev/firmware/setup_env_slac.sh\n```\n\n2) Go to the target directory and make the firmware:\n\n```bash\n$ cd rfsoc-4x2-photon-detector-dev/firmware/targets/Rfsoc4x2PhotonDetectorDev/\n$ make\n```\n\n3) Optional: Review the results in GUI mode\n\n```bash\n$ make gui\n```\n\nThe .bit and .XSA files are dumped into the Rfsoc4x2PhotonDetectorDev/image directory:\n\n```bash\n$ ls -lath ../Rfsoc4x2PhotonDetectorDev/images/\ntotal 36M\ndrwxr-xr-x 2 ruckman re 2.0K Apr 25 12:47 .\n-rw-r--r-- 1 ruckman re 2.7M Apr 25 12:47 Rfsoc4x2PhotonDetectorDev-0x01000000-20230425123732-ruckman-b869419.xsa\n-rw-r--r-- 1 ruckman re  33M Apr 25 12:47 Rfsoc4x2PhotonDetectorDev-0x01000000-20230425123732-ruckman-b869419.bit\ndrwxr-xr-x 5 ruckman re 2.0K Apr 25 12:47 ..\n```\n\n\u003c!--- ######################################################## --\u003e\n\n# How to build Petalinux images\n\n1) Generate the .bit and .xsa files (refer to `How to generate the RFSoC .BIT and .XSA files` instructions).\n\n2) Setup Xilinx licensing and petalinux software (if on SLAC AFS network) else requires Xilinx \u0026 petalinux install on your local machine\n\n```bash\n$ source rfsoc-4x2-photon-detector-dev/firmware/setup_env_slac.sh\n$ source /path/to/petalinux/2022.2/settings.sh\n```\n\n3) Go to the target directory and run the `CreatePetalinuxProject.sh` script with arg pointing to path of .XSA file:\n\n```bash\n$ cd rfsoc-4x2-photon-detector-dev/firmware/targets/Rfsoc4x2PhotonDetectorDev/\n$ source CreatePetalinuxProject.sh images/Rfsoc4x2PhotonDetectorDev-0x01000000-20230425123732-ruckman-b869419.xsa\n```\n\n\u003c!--- ######################################################## --\u003e\n\n# How to make the SD memory card for the first time\n\n1) Creating Two Partitions.  Refer to URL below\n\nhttps://xilinx-wiki.atlassian.net/wiki/x/EYMfAQ\n\n2) Copy For the boot images, simply copy the files to the FAT partition.\nThis typically will include system.bit, BOOT.BIN, image.ub, and boot.scr.  Here's an example:\n\nNote: Assumes SD memory FAT32 is `/dev/sde1` in instructions below\n\n```bash\nsudo mkdir -p boot\nsudo mount /dev/sde1 boot\nsudo cp rfsoc-4x2-photon-detector-dev/firmware/build/petalinux/Rfsoc4x2PhotonDetectorDev/images/linux/system.bit boot/.\nsudo cp rfsoc-4x2-photon-detector-dev/firmware/build/petalinux/Rfsoc4x2PhotonDetectorDev/images/linux/BOOT.BIN   boot/.\nsudo cp rfsoc-4x2-photon-detector-dev/firmware/build/petalinux/Rfsoc4x2PhotonDetectorDev/images/linux/image.ub   boot/.\nsudo cp rfsoc-4x2-photon-detector-dev/firmware/build/petalinux/Rfsoc4x2PhotonDetectorDev/images/linux/boot.scr   boot/.\nsudo sync boot/\nsudo umount boot\n```\n\n3) Power down the RFSoC board and plug in the SD memory card\n\n4) Power up the RFSoC board\n\n5) Confirm that you can ping the boot after it boots up\n\n\u003c!--- ######################################################## --\u003e\n\n# How to remote update the firmware bitstream\n\n- Assumes the DHCP assigned IP address is 10.0.0.10\n\n1) Using \"scp\" to copy your .bit file to the SD memory card on the RFSoC.  Here's an example:\n\n```bash\nssh-keygen -f \"$HOME/.ssh/known_hosts\" -R \"10.0.0.10\" # https://jira.slac.stanford.edu/browse/ESRFOC-54\nscp Rfsoc4x2PhotonDetectorDev-0x01000000-20220204204648-ruckman-90df89c.bit root@10.0.0.10:/boot/system.bit\n```\n\n2) Send a \"sync\" and \"reboot\" command to the RFSoC to load new firmware:  Here's an example:\n\n```bash\nssh root@10.0.0.10 '/bin/sync; /sbin/reboot'\n```\n\n\u003c!--- ######################################################## --\u003e\n\n# How to install the Rogue With Anaconda\n\n\u003e https://slaclab.github.io/rogue/installing/anaconda.html\n\n\u003c!--- ######################################################## --\u003e\n\n# How to run the Rogue GUI\n\n- Assumes the DHCP assigned IP address is 10.0.0.10\n\n1) Setup the rogue environment (if on SLAC AFS network) else install rogue (recommend Anaconda method) on your local machine\n\n```bash\n$ source rfsoc-4x2-photon-detector-dev/software/setup_env_slac.sh\n```\n\n2) Go to software directory and lauch the GUI:\n\n```bash\n$ cd rfsoc-4x2-photon-detector-dev/software\n$ python scripts/devGui.py --ip 10.0.0.10\n```\n\n\u003c!--- ######################################################## --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslaclab%2Frfsoc-4x2-photon-detector-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslaclab%2Frfsoc-4x2-photon-detector-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslaclab%2Frfsoc-4x2-photon-detector-dev/lists"}