{"id":18304468,"url":"https://github.com/spinalhdl/spinalworkshop","last_synced_at":"2025-04-10T19:06:03.009Z","repository":{"id":85972134,"uuid":"114655180","full_name":"SpinalHDL/SpinalWorkshop","owner":"SpinalHDL","description":"Labs to learn SpinalHDL","archived":false,"fork":false,"pushed_at":"2024-07-04T08:10:33.000Z","size":15706,"stargazers_count":148,"open_issues_count":7,"forks_count":41,"subscribers_count":10,"default_branch":"workshop","last_synced_at":"2025-03-24T16:47:31.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SpinalHDL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-12-18T15:12:32.000Z","updated_at":"2025-03-24T01:10:38.000Z","dependencies_parsed_at":"2024-01-04T10:28:02.555Z","dependency_job_id":"1e48c95c-997c-4eba-ac50-f588132c52ed","html_url":"https://github.com/SpinalHDL/SpinalWorkshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalWorkshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalWorkshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalWorkshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpinalHDL%2FSpinalWorkshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpinalHDL","download_url":"https://codeload.github.com/SpinalHDL/SpinalWorkshop/tar.gz/refs/heads/workshop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248279196,"owners_count":21077406,"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-11-05T15:29:01.078Z","updated_at":"2025-04-10T19:06:02.987Z","avatar_url":"https://github.com/SpinalHDL.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## SpinalHDL labs\nThere is the list of RTL labs :\n\n- Counter : src/main/scala/workshop/counter\n- PWM with APB : src/main/scala/workshop/pwm\n- UART : src/main/scala/workshop/uart\n- Prime : src/main/scala/workshop/prime\n- Function : src/main/scala/workshop/function\n- Apb3Decoder : src/main/scala/workshop/apb3decoder\n- Timer with BusSlaveFactory : src/main/scala/workshop/timer\n- Blackbox and Clockdomain : src/main/scala/workshop/blackboxAndClock\n- Stream : src/main/scala/workshop/stream\n- Mandelbrot : src/main/scala/workshop/mandelbrot\n- UDP : src/main/scala/workshop/udp\n- WavePlayer : src/main/scala/workshop/waveplayer\n\nIn each labs, there is an assets folder which contain a starting template and a solution.\u003cbr\u003e\nIn each labs, there is an spec.md which give basics of the lab. (You can get the Intellij plugin to read it in the IDE)\u003cbr\u003e\nIn the case a lab specification isn't clear, you can find in waves.tar.gz the corresponding working waves.\u003cbr\u003e\nThose labs make the assumption that you are already comfortable with standards HDL.\n\n\n### Generate your RTL\nFor each labs, you will find a scala main which will generate your RTL.\n\nFor example, to run the `CounterMain` by using SBT, you can do as following in the root folder of this repository :\n\n```sh\nsbt\nrunMain workshop.counter.CounterMain\n\n# Run again\nrunMain workshop.counter.CounterMain\n\n# Run again\nrunMain workshop.counter.CounterMain\n```\n\nOr in a single (But slower) command :\n\n```sh\nsbt \"runMain workshop.counter.CounterMain\"\n```\n\nAll generated RTL will be in root_of_this_repository/rtl.\n\n### Test your RTL\nFor each labs, you will find an automated regression suite in src/test/scala/workshop/xxx\n\nFor example, to run the `CounterTester` regression by using SBT, you can do as following in the root folder of this repository :\n\n```sh\nsbt\ntestOnly *.CounterTester\n\n# To test again\ntestOnly *.CounterTester\n\n# To test again\ntestOnly *.CounterTester\n```\n\nOr in a single (But slower) command :\n\n```sh\nsbt \"testOnly *.CounterTester\"\n```\n\nNote : Each tester regenerate the hardware, you don't need to do it manually.\n\nAll simulation waves files will be written in root_of_this_repository/waves in the VCD format.\n\n\n\n## SpinalSim labs\nThere is the list of SpinalSim labs :\n\n- SimCounter : src/main/python/workshop/simCounter\n- SimStreamJoinFork : src/main/python/workshop/simStreamJoinFork\n\n\nIn each labs, there is an assets folder which contain a starting template and a solution.\u003cbr\u003e\nIn each labs, there is an spec.md which give basics of the lab. (You can get the Intellij plugin to read it in the IDE)\u003cbr\u003e\nFor SpinalSim, the simulation waves are located in the simWorkspace folder.\n\n## Cocotb labs\nThere is the list of Cocotb labs :\n\n- Counter with cocotb : src/test/python/workshop/counter\n- FIFO with cocotb : src/test/python/workshop/fifo\n\nTo run cocotb labs, you have to run `make` in the testbench folder.\n\n\n## Minimum requirements\nThose labs use various tools to generate and verify the hardware :\n\n- java 8\n- SBT\n- Verilator\n- Icarus Verilog\n- Cocotb (http://cocotb.readthedocs.io/en/latest/quickstart.html#installing-cocotb)\n- Cocotb path in the 'COCOTB' environment variable\n- GTKwave to open simulation waves (./waves/*.vcd)\n\nFor the first row of labs, you don't need cocotb/python stuffs.\n\n\nThere is how to setup by command line a Debian distribution :\n\n```sh\n# JAVA 8\nsudo add-apt-repository -y ppa:openjdk-r/ppa\nsudo apt-get update\nsudo apt-get install openjdk-8-jdk -y\nsudo update-alternatives --config java\nsudo update-alternatives --config javac\n\n# SBT\necho \"deb https://dl.bintray.com/sbt/debian /\" | sudo tee -a /etc/apt/sources.list.d/sbt.list\nsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823\nsudo apt-get update\nsudo apt-get install sbt -y\n\n# Verilator\nsudo apt-get install git make autoconf g++ flex bison -y  # First time prerequisites\ngit clone http://git.veripool.org/git/verilator   # Only first time\n\nunsetenv VERILATOR_ROOT  # For csh; ignore error if on bash\nunset VERILATOR_ROOT  # For bash\ncd verilator\ngit pull        # Make sure we're up-to-date\ngit tag         # See what versions exist\n#git checkout HEAD                 # Use HEAD development version\n#git checkout verilator_{version}  # Switch to specified version\nautoconf        # Create ./configure script\n./configure\nmake -j$(nproc)\nsudo make install\ncd ..\n\n# iverilog (debian package 9.7 contain bugs)\nsudo apt-get install -y gperf readline-common bison flex autoconf\nwget https://github.com/steveicarus/iverilog/archive/v10_0.tar.gz\ntar -xvf v10_0.tar.gz\ncd iverilog-10_0\nautoconf\n./configure\nmake -j4\nsudo make install\ncd ..\n\n# COCOTB\nsudo apt-get install -y git make gcc g++ swig python-dev\ngit clone https://github.com/potentialventures/cocotb\nexport COCOTB=$(pwd)/cocotb\necho export COCOTB=$(pwd)/cocotb \u003e\u003e ~/.bashrc \n\n# GTKwave\nsudo apt-get install gtkwave -y\n\n# Used for the mandelbrot lab\nsudo apt-get install python-tk -y\n\n# Clone this repo\ngit clone --recursive https://github.com/SpinalHDL/SpinalWorkshop.git SpinalWorkshop\ncd SpinalWorkshop\nsbt compile\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinalhdl%2Fspinalworkshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinalhdl%2Fspinalworkshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinalhdl%2Fspinalworkshop/lists"}