Skip to content

Initial setup

Here are three ways to practice the examples featured in this tutorial.

Google Colab - Online interpreter/notebook (Most convenient)

For each chapter, I've created a Google Colab notebook. It is based on Jupyter notebooks, which allows text and executable code to co-exist.

  1. Here is the link to Chapter 1 Google Colab
  2. Login with your gmail account, and click on the Copy to Drive button.
  3. Simply click the button on a code block to execute it.
  4. Edit and play around with each code block

Google colab example

Linux or MacOS (Preferred method)

  • If you are a student or a working professional, you typically have access to a Linux machine through SSH/Putty or VNC.
  • This is the preferred method because you will be learning to write Python code in the same environment where you are working with SystemVerilog code.
  • You can launch Python by entering python3 in your Linux terminal. This also works for MacOS.
  • This is the method used for the code in this tutorial. Here is an example of what you will see when you enter python3 on a Linux terminal.
% python3
Python 3.9.6 (default, Oct  4 2024, 08:01:31) 
Type "help", "copyright", "credits" or "license" for more information.

>>> hex(500)
'0x1f4'

>>> '/'.join(['user', 'path', 'dir'])
'user/path/dir'

VS Code

VS Code is, arguable, the most popular IDE at the moment. This will allow you to follow the tutorial from your Windows or MacOS PC.

  1. Download VS Code
  2. Create a new file and name it test.py
  3. To run this python script, launch a terminal
  4. Type python3 test.py into it

VSCode terminal

VSCode run script

Read this next

Table of contents Chapter 1: Lists and dictionaries