DEPRECATED. Use this instead.
https://gitlab.com/mosaic_group/mosaic_os/laygo2_iic
The idea of this repo is to have the minimum requirements to run laygo2 with sky130 support inside the iic-osic-tools docker container.
This is for people that only want to use laygo2 without previous work.
Clone the repo anywhere. Laygo2 is a submodule of the repo, so we have to bring it.
$ git submodule init
$ git submodule update
Execute start_x.sh
(Unix/Mac) or start_x.bat
(Windows).
You will need an X server, read the iic-osic-tools readme for instructions.
Inside the container you will see
/foss/
designs/
laygo2/
laygo2_reduced_workspace/
README.md
start_x.bat
start_x.sh
...
The mapping is
[Host] /path/to/laygo2_iic
[Container] ~/foss/designs/<laygo2_repo_content>
This is for people who is already using iic-osic-tools
container with a mapped directory.
Clone the repo in the directory. Laygo2 is a submodule of the repo, so we have to bring it.
$ git submodule init
$ git submodule update
Inside a container terminal, go to laygo2_iic/laygo2_reduced_workspace/
and run
$ ./route_modifier.sh
Thit script modifies paths in:
- .maginit
- compile_tcl.sh
- laygo2_example/paths.py
The "sky130.magicrc" path shoudn't have changed, since is based in "iic-osic-tools", but if that's the case, see item 3.
Everything should work in the same way.
Inside the container you will see
/foss/
designs/
laygo2_iic/
laygo2/
laygo2_reduced_workspace/
README.md
start_x.bat
start_x.sh
...
This is for people who has magic and openpdk installed on their systems, or in a linux vm, or wsl with an X server, you name it.
Clone the repo anywhere. Laygo2 is a submodule of the repo, so we have to bring it.
$ git submodule init
$ git submodule update
UNTIL NOW, THIS IS NOT SUPPORTED, you had to replace the path in .maginit manually
First, you have to find the file "sky130.magicrc". Then go to laygo2_iic/laygo2_reduced_workspace/
and run
$ ./route_modifier.sh /path/to/sky130A.magicrc
Thit script modifies paths in:
- .maginit
- compile_tcl.sh
- laygo2_example/paths.py
Basically, you need to have docker and a X11 server.
- Install Docker https://docs.docker.com/engine/install/ubuntu/
- Install Docker Desktop
- Install XQuartz
- XQuartz preference -> secure tap -> enable two options.
- Install Docker Desktop
- Install Vcxsvr
- Start XLaunch with:
- Multiple Windows
- Display Number 0
- Start no client
- Clipboard + Primary Selection
- Native OpenGL
- Disable access control
- Use Powershell, not cmd
The workflow is:
- Generate the *.tcl files with ipython and examples
$ ./compile_tcl.sh laygo2_example/inv.py
$ ./compile_tcl.sh laygo2_example/tinv.py
$ ./compile_tcl.sh laygo2_example/tinv_small_1x.py
$ ./compile_tcl.sh laygo2_example/dff.py
- Compile the layouts with magic.
$ ./start_mag.sh
% source logic_generated_inv_2x.tcl
% exit
// OR
$ ./start_mag_console.sh logic_generated_inv_2x.tcl
% exit
Windows and Linux has a subtle but annoying difference: The line termination. Git internally uses the linux termination, if you are using windows the workspace files will use the windows format. When a commit is made, all the stagged files will translate into unix format before being stored into git's internal database.
The problem with this arise when using iic-osic-tools on windows and some bash scripts will raise this error:
-bash: ./start_x.sh: /bin/bash^M: bad interpreter: No such file or directory
The simple fix is changing the format with vim.
Note: <ESC>
and <ENTER>
means the keys, don't write them.
vim <file>
<ESC>:set ff=unix<ENTER>
<ESC>:wq<ENTER>
We are working in resolve this with local git configuration, and avoid file format modifications.
It only exists because we need -rcfile .maginit
as parameter to set the PATH to laygo2 microtemplates and generated logic.
If we update the path in some system .magicrc
file, this script will become unnecesary.
Another problem that we had to consider: Decouple from sky130 technology.
Pip has an option to install packages from git, but we have never done it before.
Why we have so many variables? Which ones are necesary by laygo2? Do we need bag support?
If you can generate the layout withouth them, feel free to remove them for now. And they will, take it for sure.
In the troubleshoot is explained this problem and a workaround.
It is in /headless/.bashrc We can add the following code
if [ -f /foss/designs/.fossrc ]; then
. /foss/designs/.fossrc ]
fi
With this script, any user can customize his container. This will serve as a roundabout until laygo2 is integrated into the container.
We can have a file in /foss/tools/.magicrc
or something like that, it will reference the pdk (not fixed to sky130).
Maybe we should save that templates into another repo, and when we download them when is required.