mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-30 19:22:31 +00:00 
			
		
		
		
	Reapply "Merge pull request #5301 from KrystalDelusion/krys/re_5280"
This reverts commit 88eb83a0c3.
			
			
This commit is contained in:
		
							parent
							
								
									727998f663
								
							
						
					
					
						commit
						f102b25914
					
				
					 7 changed files with 171 additions and 34 deletions
				
			
		
							
								
								
									
										16
									
								
								.github/workflows/extra-builds.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/extra-builds.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,14 @@ | ||||||
| name: Test extra build flows | name: Test extra build flows | ||||||
| 
 | 
 | ||||||
| on: [push, pull_request] | on: | ||||||
|  |   # always test main | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   # test PRs | ||||||
|  |   pull_request: | ||||||
|  |   # allow triggering tests, ignores skip check | ||||||
|  |   workflow_dispatch: | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   pre_job: |   pre_job: | ||||||
|  | @ -11,11 +19,11 @@ jobs: | ||||||
|       - id: skip_check |       - id: skip_check | ||||||
|         uses: fkirc/skip-duplicate-actions@v5 |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|         with: |         with: | ||||||
|  |           # don't run on documentation changes | ||||||
|           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' |           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' | ||||||
|           # cancel previous builds if a new commit is pushed |           # cancel previous builds if a new commit is pushed | ||||||
|           cancel_others: 'true' |           # but never cancel main | ||||||
|           # only run on push *or* pull_request, not both |           cancel_others: ${{ github.ref != 'refs/heads/main' }} | ||||||
|           concurrent_skipping: 'same_content_newer' |  | ||||||
| 
 | 
 | ||||||
|   vs-prep: |   vs-prep: | ||||||
|     name: Prepare Visual Studio build |     name: Prepare Visual Studio build | ||||||
|  |  | ||||||
							
								
								
									
										44
									
								
								.github/workflows/test-build.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										44
									
								
								.github/workflows/test-build.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,14 @@ | ||||||
| name: Build and run tests | name: Build and run tests | ||||||
| 
 | 
 | ||||||
| on: [push, pull_request] | on: | ||||||
|  |   # always test main | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   # test PRs | ||||||
|  |   pull_request: | ||||||
|  |   # allow triggering tests, ignores skip check | ||||||
|  |   workflow_dispatch: | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   pre_job: |   pre_job: | ||||||
|  | @ -11,11 +19,12 @@ jobs: | ||||||
|       - id: skip_check |       - id: skip_check | ||||||
|         uses: fkirc/skip-duplicate-actions@v5 |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|         with: |         with: | ||||||
|  |           # don't run on documentation changes | ||||||
|           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' |           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' | ||||||
|           # cancel previous builds if a new commit is pushed |           # cancel previous builds if a new commit is pushed | ||||||
|           cancel_others: 'true' |           # but never cancel main | ||||||
|           # only run on push *or* pull_request, not both |           cancel_others: ${{ github.ref != 'refs/heads/main' }} | ||||||
|           concurrent_skipping: 'same_content_newer' | 
 | ||||||
|   pre_docs_job: |   pre_docs_job: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     outputs: |     outputs: | ||||||
|  | @ -24,15 +33,16 @@ jobs: | ||||||
|       - id: skip_check |       - id: skip_check | ||||||
|         uses: fkirc/skip-duplicate-actions@v5 |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|         with: |         with: | ||||||
|  |           # don't run on readme changes | ||||||
|           paths_ignore: '["**/README.md"]' |           paths_ignore: '["**/README.md"]' | ||||||
|           # cancel previous builds if a new commit is pushed |           # cancel previous builds if a new commit is pushed | ||||||
|           cancel_others: 'true' |           # but never cancel main | ||||||
|           # only run on push *or* pull_request, not both |           cancel_others: ${{ github.ref != 'refs/heads/main' }} | ||||||
|           concurrent_skipping: 'same_content_newer' |  | ||||||
| 
 | 
 | ||||||
|   build-yosys: |   build-yosys: | ||||||
|     name: Reusable build |     name: Reusable build | ||||||
|     runs-on: ${{ matrix.os }} |     runs-on: ${{ matrix.os }} | ||||||
|  |     # pre_job is a subset of pre_docs_job, so we can always build for pre_docs_job | ||||||
|     needs: pre_docs_job |     needs: pre_docs_job | ||||||
|     if: needs.pre_docs_job.outputs.should_skip != 'true' |     if: needs.pre_docs_job.outputs.should_skip != 'true' | ||||||
|     env: |     env: | ||||||
|  | @ -40,7 +50,6 @@ jobs: | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, macos-latest] |         os: [ubuntu-latest, macos-latest] | ||||||
|         sanitizer: [undefined, address] |  | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout Yosys |       - name: Checkout Yosys | ||||||
|  | @ -58,7 +67,6 @@ jobs: | ||||||
|           mkdir build |           mkdir build | ||||||
|           cd build |           cd build | ||||||
|           make -f ../Makefile config-$CC |           make -f ../Makefile config-$CC | ||||||
|           echo 'SANITIZER = ${{ matrix.sanitizer }}' >> Makefile.conf |  | ||||||
|           make -f ../Makefile -j$procs ENABLE_LTO=1 |           make -f ../Makefile -j$procs ENABLE_LTO=1 | ||||||
| 
 | 
 | ||||||
|       - name: Log yosys-config output |       - name: Log yosys-config output | ||||||
|  | @ -74,7 +82,7 @@ jobs: | ||||||
|       - name: Store build artifact |       - name: Store build artifact | ||||||
|         uses: actions/upload-artifact@v4 |         uses: actions/upload-artifact@v4 | ||||||
|         with: |         with: | ||||||
|           name: build-${{ matrix.os }}-${{ matrix.sanitizer }} |           name: build-${{ matrix.os }} | ||||||
|           path: build.tar |           path: build.tar | ||||||
|           retention-days: 1 |           retention-days: 1 | ||||||
| 
 | 
 | ||||||
|  | @ -85,12 +93,9 @@ jobs: | ||||||
|     if: needs.pre_job.outputs.should_skip != 'true' |     if: needs.pre_job.outputs.should_skip != 'true' | ||||||
|     env: |     env: | ||||||
|       CC: clang |       CC: clang | ||||||
|       ASAN_OPTIONS: halt_on_error=1 |  | ||||||
|       UBSAN_OPTIONS: halt_on_error=1 |  | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest, macos-latest] |         os: [ubuntu-latest, macos-latest] | ||||||
|         sanitizer: [undefined, address] |  | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout Yosys |       - name: Checkout Yosys | ||||||
|  | @ -102,11 +107,12 @@ jobs: | ||||||
|         uses: ./.github/actions/setup-build-env |         uses: ./.github/actions/setup-build-env | ||||||
| 
 | 
 | ||||||
|       - name: Get iverilog |       - name: Get iverilog | ||||||
|  |         id: get-iverilog | ||||||
|         shell: bash |         shell: bash | ||||||
|         run: | |         run: | | ||||||
|           git clone https://github.com/steveicarus/iverilog.git |           git clone https://github.com/steveicarus/iverilog.git | ||||||
|           cd iverilog |           cd iverilog | ||||||
|           echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_ENV |           echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||||||
| 
 | 
 | ||||||
|       - name: Get vcd2fst |       - name: Get vcd2fst | ||||||
|         shell: bash |         shell: bash | ||||||
|  | @ -123,7 +129,7 @@ jobs: | ||||||
|         uses: actions/cache@v4 |         uses: actions/cache@v4 | ||||||
|         with: |         with: | ||||||
|           path: .local/ |           path: .local/ | ||||||
|           key: ${{ matrix.os }}-${IVERILOG_GIT} |           key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} | ||||||
| 
 | 
 | ||||||
|       - name: Build iverilog |       - name: Build iverilog | ||||||
|         if: steps.cache-iverilog.outputs.cache-hit != 'true' |         if: steps.cache-iverilog.outputs.cache-hit != 'true' | ||||||
|  | @ -139,7 +145,7 @@ jobs: | ||||||
|       - name: Download build artifact |       - name: Download build artifact | ||||||
|         uses: actions/download-artifact@v4 |         uses: actions/download-artifact@v4 | ||||||
|         with: |         with: | ||||||
|           name: build-${{ matrix.os }}-${{ matrix.sanitizer }} |           name: build-${{ matrix.os }} | ||||||
| 
 | 
 | ||||||
|       - name: Uncompress build |       - name: Uncompress build | ||||||
|         shell: bash |         shell: bash | ||||||
|  | @ -171,7 +177,6 @@ jobs: | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest] |         os: [ubuntu-latest] | ||||||
|         sanitizer: [undefined] |  | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout Yosys |       - name: Checkout Yosys | ||||||
|         uses: actions/checkout@v4 |         uses: actions/checkout@v4 | ||||||
|  | @ -184,7 +189,7 @@ jobs: | ||||||
|       - name: Download build artifact |       - name: Download build artifact | ||||||
|         uses: actions/download-artifact@v4 |         uses: actions/download-artifact@v4 | ||||||
|         with: |         with: | ||||||
|           name: build-${{ matrix.os }}-${{ matrix.sanitizer }} |           name: build-${{ matrix.os }} | ||||||
| 
 | 
 | ||||||
|       - name: Uncompress build |       - name: Uncompress build | ||||||
|         shell: bash |         shell: bash | ||||||
|  | @ -209,7 +214,6 @@ jobs: | ||||||
|     strategy: |     strategy: | ||||||
|       matrix: |       matrix: | ||||||
|         os: [ubuntu-latest] |         os: [ubuntu-latest] | ||||||
|         sanitizer: [undefined, address] |  | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|     steps: |     steps: | ||||||
|       - name: Checkout Yosys |       - name: Checkout Yosys | ||||||
|  | @ -223,7 +227,7 @@ jobs: | ||||||
|       - name: Download build artifact |       - name: Download build artifact | ||||||
|         uses: actions/download-artifact@v4 |         uses: actions/download-artifact@v4 | ||||||
|         with: |         with: | ||||||
|           name: build-${{ matrix.os }}-${{ matrix.sanitizer }} |           name: build-${{ matrix.os }} | ||||||
| 
 | 
 | ||||||
|       - name: Uncompress build |       - name: Uncompress build | ||||||
|         shell: bash |         shell: bash | ||||||
|  |  | ||||||
							
								
								
									
										16
									
								
								.github/workflows/test-compile.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/test-compile.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,14 @@ | ||||||
| name: Compiler testing | name: Compiler testing | ||||||
| 
 | 
 | ||||||
| on: [push, pull_request] | on: | ||||||
|  |   # always test main | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   # test PRs | ||||||
|  |   pull_request: | ||||||
|  |   # allow triggering tests, ignores skip check | ||||||
|  |   workflow_dispatch: | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   pre_job: |   pre_job: | ||||||
|  | @ -11,11 +19,11 @@ jobs: | ||||||
|       - id: skip_check |       - id: skip_check | ||||||
|         uses: fkirc/skip-duplicate-actions@v5 |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|         with: |         with: | ||||||
|  |           # don't run on documentation changes | ||||||
|           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' |           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' | ||||||
|           # cancel previous builds if a new commit is pushed |           # cancel previous builds if a new commit is pushed | ||||||
|           cancel_others: 'true' |           # but never cancel main | ||||||
|           # only run on push *or* pull_request, not both |           cancel_others: ${{ github.ref != 'refs/heads/main' }} | ||||||
|           concurrent_skipping: 'same_content_newer' |  | ||||||
| 
 | 
 | ||||||
|   test-compile: |   test-compile: | ||||||
|     runs-on: ${{ matrix.os }} |     runs-on: ${{ matrix.os }} | ||||||
|  |  | ||||||
							
								
								
									
										109
									
								
								.github/workflows/test-sanitizers.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								.github/workflows/test-sanitizers.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,109 @@ | ||||||
|  | name: Check clang sanitizers | ||||||
|  | 
 | ||||||
|  | on: | ||||||
|  |   # always test main | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   # ignore PRs due to time needed | ||||||
|  |   # allow triggering tests, ignores skip check | ||||||
|  |   workflow_dispatch: | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   pre_job: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     outputs: | ||||||
|  |       should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||||||
|  |     steps: | ||||||
|  |       - id: skip_check | ||||||
|  |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|  |         with: | ||||||
|  |           # don't run on documentation changes | ||||||
|  |           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' | ||||||
|  | 
 | ||||||
|  |   run_san: | ||||||
|  |     name: Build and run tests | ||||||
|  |     runs-on: ${{ matrix.os }} | ||||||
|  |     needs: pre_job | ||||||
|  |     if: needs.pre_job.outputs.should_skip != 'true' | ||||||
|  |     env: | ||||||
|  |       CC: clang | ||||||
|  |       ASAN_OPTIONS: halt_on_error=1 | ||||||
|  |       UBSAN_OPTIONS: halt_on_error=1 | ||||||
|  |     strategy: | ||||||
|  |       matrix: | ||||||
|  |         os: [ubuntu-latest, macos-latest] | ||||||
|  |         sanitizer: ['undefined,address'] | ||||||
|  |       fail-fast: false | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout Yosys | ||||||
|  |         uses: actions/checkout@v4 | ||||||
|  |         with: | ||||||
|  |           submodules: true | ||||||
|  |           persist-credentials: false | ||||||
|  | 
 | ||||||
|  |       - name: Setup environment | ||||||
|  |         uses: ./.github/actions/setup-build-env | ||||||
|  | 
 | ||||||
|  |       - name: Get iverilog | ||||||
|  |         id: get-iverilog | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           git clone https://github.com/steveicarus/iverilog.git | ||||||
|  |           cd iverilog | ||||||
|  |           echo "IVERILOG_GIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||||||
|  | 
 | ||||||
|  |       - name: Get vcd2fst | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           git clone https://github.com/mmicko/libwave.git | ||||||
|  |           mkdir -p ${{ github.workspace }}/.local/ | ||||||
|  |           cd libwave | ||||||
|  |           cmake . -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.local | ||||||
|  |           make -j$procs | ||||||
|  |           make install | ||||||
|  | 
 | ||||||
|  |       - name: Cache iverilog | ||||||
|  |         id: cache-iverilog | ||||||
|  |         uses: actions/cache@v4 | ||||||
|  |         with: | ||||||
|  |           path: .local/ | ||||||
|  |           key: ${{ matrix.os }}-${{ steps.get-iverilog.outputs.IVERILOG_GIT }} | ||||||
|  | 
 | ||||||
|  |       - name: Build iverilog | ||||||
|  |         if: steps.cache-iverilog.outputs.cache-hit != 'true' | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           mkdir -p ${{ github.workspace }}/.local/ | ||||||
|  |           cd iverilog | ||||||
|  |           autoconf | ||||||
|  |           CC=gcc CXX=g++ ./configure --prefix=${{ github.workspace }}/.local | ||||||
|  |           make -j$procs | ||||||
|  |           make install | ||||||
|  | 
 | ||||||
|  |       - name: Check iverilog | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           iverilog -V | ||||||
|  | 
 | ||||||
|  |       - name: Build | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           make config-$CC | ||||||
|  |           echo 'SANITIZER = ${{ matrix.sanitizer }}' >> Makefile.conf | ||||||
|  |           make -j$procs ENABLE_LTO=1 | ||||||
|  | 
 | ||||||
|  |       - name: Log yosys-config output | ||||||
|  |         run: | | ||||||
|  |           ./yosys-config || true | ||||||
|  | 
 | ||||||
|  |       - name: Run tests | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           make -j$procs test TARGETS= EXTRA_TARGETS= CONFIG=$CC | ||||||
|  | 
 | ||||||
|  |       - name: Report errors | ||||||
|  |         if: ${{ failure() }} | ||||||
|  |         shell: bash | ||||||
|  |         run: | | ||||||
|  |           find tests/**/*.err -print -exec cat {} \; | ||||||
							
								
								
									
										16
									
								
								.github/workflows/test-verific.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/workflows/test-verific.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -1,6 +1,14 @@ | ||||||
| name: Build and run tests with Verific (Linux) | name: Build and run tests with Verific (Linux) | ||||||
| 
 | 
 | ||||||
| on: [push, pull_request] | on: | ||||||
|  |   # always test main | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - main | ||||||
|  |   # test PRs | ||||||
|  |   pull_request: | ||||||
|  |   # allow triggering tests, ignores skip check | ||||||
|  |   workflow_dispatch: | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   pre-job: |   pre-job: | ||||||
|  | @ -11,11 +19,11 @@ jobs: | ||||||
|       - id: skip_check |       - id: skip_check | ||||||
|         uses: fkirc/skip-duplicate-actions@v5 |         uses: fkirc/skip-duplicate-actions@v5 | ||||||
|         with: |         with: | ||||||
|  |           # don't run on documentation changes | ||||||
|           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' |           paths_ignore: '["**/README.md", "docs/**", "guidelines/**"]' | ||||||
|           # cancel previous builds if a new commit is pushed |           # cancel previous builds if a new commit is pushed | ||||||
|           cancel_others: 'true' |           # but never cancel main | ||||||
|           # only run on push *or* pull_request, not both |           cancel_others: ${{ github.ref != 'refs/heads/main' }} | ||||||
|           concurrent_skipping: 'same_content_newer' |  | ||||||
| 
 | 
 | ||||||
|   test-verific: |   test-verific: | ||||||
|     needs: pre-job |     needs: pre-job | ||||||
|  |  | ||||||
|  | @ -880,7 +880,7 @@ struct Parser { | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
| 				} | 				} | ||||||
| 				var.clk_en = find_single_cap(pdef.clken, cram.options, portopts, "clken"); | 				var.clk_en = find_single_cap(pdef.clken, cram.options, portopts, "clken") != nullptr; | ||||||
| 			} | 			} | ||||||
| 			const PortWidthDef *wdef = find_single_cap(pdef.width, cram.options, portopts, "width"); | 			const PortWidthDef *wdef = find_single_cap(pdef.width, cram.options, portopts, "width"); | ||||||
| 			if (wdef) { | 			if (wdef) { | ||||||
|  |  | ||||||
|  | @ -109,7 +109,7 @@ struct PortVariant { | ||||||
| 	PortKind kind; | 	PortKind kind; | ||||||
| 	int clk_shared; | 	int clk_shared; | ||||||
| 	ClkPolKind clk_pol; | 	ClkPolKind clk_pol; | ||||||
| 	bool clk_en; | 	bool clk_en = false; | ||||||
| 	bool width_tied; | 	bool width_tied; | ||||||
| 	int min_wr_wide_log2; | 	int min_wr_wide_log2; | ||||||
| 	int max_wr_wide_log2; | 	int max_wr_wide_log2; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue