Skip to content

Commit 83bf877

Browse files
authored
Merge branch 'master' into master
2 parents 7908e94 + f82aa73 commit 83bf877

245 files changed

Lines changed: 23962 additions & 2606 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codespellrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ quiet-level = 3
4040
# correctly.
4141
ignore-words-list = subtile,
4242
subtiles,
43+
# yosys ff cell type name (dff with enable + reset).
44+
dffer,
4345
fle,
4446
EArch,
4547
FPT,

.github/workflows/test.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,97 @@ jobs:
756756
vtr_flow/**/parse_results*.txt
757757
758758
759+
RegressionWithMosaic:
760+
runs-on: ubuntu-24.04
761+
needs: [BuildVTR]
762+
strategy:
763+
fail-fast: false
764+
matrix:
765+
include: [
766+
{
767+
name: 'Mosaic_regression',
768+
suite: 'vtr_reg_basic_mosaic',
769+
extra_pkgs: 'verilator'
770+
}
771+
]
772+
name: 'R: ${{ matrix.name }}'
773+
steps:
774+
775+
- uses: actions/setup-python@v7
776+
with:
777+
python-version: 3.12.3
778+
779+
- uses: actions/checkout@v7
780+
with:
781+
submodules: 'true'
782+
783+
- name: Get number of CPU cores
784+
uses: SimenB/github-actions-cpu-cores@v3
785+
id: cpu-cores
786+
787+
- name: Install dependencies
788+
run: ./install_apt_packages.sh
789+
790+
- name: Install Extra Dependencies
791+
if: ${{ matrix.extra_pkgs != '' }}
792+
run: |
793+
sudo apt update
794+
sudo apt install -y ${{ matrix.extra_pkgs }}
795+
796+
- name: Install Python Requirements
797+
run: |
798+
pip install -r requirements.txt
799+
800+
- name: Download Build Artifact
801+
uses: actions/download-artifact@v8
802+
with:
803+
name: build-release.tar.gz
804+
805+
- name: Unpack Build
806+
shell: bash
807+
run: |
808+
tar -xvzf build.tar.gz
809+
810+
- name: Test
811+
timeout-minutes: 60
812+
run: |
813+
./run_reg_test.py ${{ matrix.suite }} -show_failures -j${{ steps.cpu-cores.outputs.count}}
814+
815+
- name: Require mosaic verilator-check pass
816+
timeout-minutes: 5
817+
run: |
818+
python3 mosaic/scripts/verify_regression_vcheck.py --suite ${{ matrix.suite }}
819+
820+
- name: Compare Parmys and Mosaic hardblock BLIF models
821+
timeout-minutes: 20
822+
run: |
823+
python3 mosaic/scripts/compare_frontend_blif_models.py --run \
824+
--circuit vtr_flow/benchmarks/verilog/diffeq1.v \
825+
--arch vtr_flow/arch/timing/k6_frac_N10_frac_chain_mem32K_40nm.xml \
826+
--work-dir mosaic_blif_model_compare
827+
828+
- name: Upload regression run files
829+
if: ${{ !cancelled() }}
830+
uses: actions/upload-artifact@v7
831+
with:
832+
name: ${{matrix.name}}_run_files
833+
path: |
834+
vtr_flow/**/*.out
835+
# vtr_flow/**/*.blif # Removed since it was taking too much space and was hardly used.
836+
vtr_flow/**/*.p
837+
vtr_flow/**/*.net
838+
vtr_flow/**/*.r
839+
840+
- name: Upload regression results
841+
if: ${{ !cancelled() }}
842+
uses: actions/upload-artifact@v7
843+
with:
844+
name: ${{matrix.name}}_results
845+
path: |
846+
vtr_flow/**/*.log
847+
vtr_flow/**/parse_results*.txt
848+
849+
759850
Sanitized:
760851
runs-on: ubuntu-24.04
761852
strategy:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,8 @@ compile_commands.json
175175

176176
vpr/test/gui/golden/tmp/*
177177

178+
#
179+
# Mosaic QoR compare output
180+
#
181+
/compare_output_*/
182+
mosaic/scripts/compare_output_*/

CMakeLists.txt

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,24 @@ option(ODIN_COVERAGE "Enable building odin with coverage flags" OFF)
5454
option(ODIN_TIDY "Enable building odin with clang tidy" OFF)
5555
option(ODIN_SANITIZE "Enable building odin with sanitize flags" OFF)
5656

57-
# Allow the user to enable building Yosys
57+
# Yosys plugins. Yosys is built when WITH_PARMYS or WITH_MOSAIC is on.
5858
option(WITH_PARMYS "Enable Yosys as elaborator and parmys-plugin as partial mapper" ON)
59+
option(WITH_MOSAIC "Enable mosaic yosys plugin as an alternative synthesis frontend" ON)
5960
option(SLANG_SYSTEMVERILOG "Enable building and installing Yosys-Slang plugin for parsing SystemVerilog" ON)
6061

62+
63+
if(${WITH_PARMYS} OR ${WITH_MOSAIC})
64+
set(WITH_YOSYS ON)
65+
else()
66+
set(WITH_YOSYS OFF)
67+
endif()
68+
69+
# slang is a yosys plugin, so skip it when neither frontend builds yosys
70+
if(${SLANG_SYSTEMVERILOG} AND NOT ${WITH_YOSYS})
71+
message(WARNING "Yosys is not enabled, disabling Yosys-Slang as well.")
72+
set(SLANG_SYSTEMVERILOG OFF)
73+
endif()
74+
6175
set(VTR_VERSION_MAJOR 9)
6276
set(VTR_VERSION_MINOR 0)
6377
set(VTR_VERSION_PATCH 0)
@@ -521,6 +535,10 @@ if(${WITH_PARMYS})
521535
add_subdirectory(parmys)
522536
endif()
523537

538+
if(${WITH_MOSAIC})
539+
add_subdirectory(mosaic)
540+
endif()
541+
524542
#Add the various tools
525543
add_compile_options(${WARN_FLAGS}) #Add warn flags for VTR tools
526544
add_compile_options(${ADDITIONAL_FLAGS})
@@ -539,15 +557,6 @@ if(${WITH_ODIN})
539557
endif()
540558
endif()
541559

542-
# handle cmake params to compile yosys-slang plugin for Yosys
543-
if(${SLANG_SYSTEMVERILOG})
544-
# avoid compiling yosys-slang plugin in case the Parmys frontend is not active
545-
if(NOT ${WITH_PARMYS})
546-
message(WARNING "Parmys is not enabled, disabling Yosys-Slang as well.")
547-
set(SLANG_SYSTEMVERILOG OFF)
548-
endif()
549-
endif()
550-
551560
#Add extra compilation flags to suppress warnings from some libraries/tools
552561
# Note that target_compile_options() *appends* to the current compilation options of
553562
# the specified target

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ ifeq ($(OS),Windows_NT)
5757
CURL_PATH:=$(shell where curl.exe 2>nul | head -n 1)
5858
# VCPKG root is a system variable env:VCPKG in power shell. User can override by using VCPKG_PATH when calling the makefile
5959
VCPKG_CMAKE_PATH:=$(subst \,/,$(VCPKG_PATH))
60-
override CMAKE_PARAMS := ${CMAKE_PARAMS} -DWITH_PARMYS=OFF -DSLANG_SYSTEMVERILOG=OFF -DVTR_IPO_BUILD=OFF -DWITH_ABC=OFF
60+
override CMAKE_PARAMS := ${CMAKE_PARAMS} -DWITH_PARMYS=OFF -DWITH_MOSAIC=OFF -DSLANG_SYSTEMVERILOG=OFF -DVTR_IPO_BUILD=OFF -DWITH_ABC=OFF
6161
# Msys2 can still use Linux gcc
6262
ifneq ($(MSYSTEM),MINGW64)
6363
override CMAKE_PARAMS := ${CMAKE_PARAMS} -DWGET="${CURL_PATH}" -DCMAKE_TOOLCHAIN_FILE="${VCPKG_CMAKE_PATH}/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_MANIFEST_MODE=OFF
64-
# override CMAKE_PARAMS := ${CMAKE_PARAMS} -DWITH_PARMYS=OFF -DSLANG_SYSTEMVERILOG=OFF -DVTR_IPO_BUILD=OFF -DWITH_ABC=OFF
64+
# override CMAKE_PARAMS := ${CMAKE_PARAMS} -DWITH_PARMYS=OFF -DWITH_MOSAIC=OFF -DSLANG_SYSTEMVERILOG=OFF -DVTR_IPO_BUILD=OFF -DWITH_ABC=OFF
6565
endif
6666
endif
6767

dev/pylint_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
paths_to_lint = [
2424
(repo_path, False),
2525
(repo_path / "dev", True),
26+
(repo_path / "mosaic", True),
2627
(repo_path / "odin_ii", True),
2728
(repo_path / "ace2", True),
2829
(repo_path / "doc", True),

doc/agents/build.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Pass via `CMAKE_PARAMS="-DOPTION=value"`:
3737
- `VTR_ENABLE_SANITIZE` — address/leak/UB sanitizers
3838
- `VTR_ENABLE_PROFILING` — gprof profiling
3939
- `VPR_USE_EZGL` — graphics library (auto/on/off)
40-
- `WITH_PARMYS` — build Yosys frontend (default ON)
40+
- `WITH_PARMYS` — build Parmys Yosys plugin (default ON)
41+
- `WITH_MOSAIC` — build mosaic Yosys plugin (default ON)
4142
- `WITH_ODIN` — build legacy Odin frontend (default OFF)
4243
- `VTR_IPO_BUILD` — interprocedural optimization (default auto/on); set to `off` during development to reduce build times and improve debuggability
44+
45+
Yosys is built when `WITH_PARMYS` or `WITH_MOSAIC` is on. At least one of those two options must be on.

doc/agents/codebase.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
|-----------|---------|
77
| `vpr/` | Core FPGA CAD tool: pack, place, route, timing |
88
| `parmys/` | Yosys-based synthesis frontend (replaces Odin) |
9+
| `mosaic/` | Yosys mosaic frontend (`-start mosaic`; see `mosaic/README.md`) |
910
| `odin_ii/` | Legacy synthesis frontend (disabled by default) |
1011
| `abc/` | Logic optimization (external, do not modify directly) |
1112
| `ace2/` | Activity estimation for power analysis |

0 commit comments

Comments
 (0)