forked from lowRISC/ibex
-
Notifications
You must be signed in to change notification settings - Fork 34
Parametrization of the SEC script regarding the use of CV-X-IF and GitHub action to run SEC on PRs with RTL changes #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cairo-caplan
wants to merge
7
commits into
openhwgroup:main
Choose a base branch
from
cairo-caplan:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d339bf6
[sec] Improved the SEC script to parameterize the checked designs, wi…
cairo-caplan 4c2f249
[sec][ci] GitHub action to perform SEC on RTL-related PRs
cairo-caplan 17774f1
Merge pull request #1 from cairo-caplan/sec_xif_gh_action
cairo-caplan cf37f20
[ci][sec] Add fusesoc installation to ci sec action
cairo-caplan 8142cd9
[ci][sec] Fix typo in SEC for XInterface action
cairo-caplan e231351
[ci][sec] added license header to pr_sec.yml
cairo-caplan f55eeb3
[doc][sec] Updated Readme for the SEC script
cairo-caplan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Copyright (c) 2025 Eclipse Foundation | ||
|
|
||
| name: CI to run SEC on RTL changes | ||
|
|
||
| on: | ||
| workflow_dispatch: {} | ||
| pull_request: | ||
| paths: | ||
| - 'rtl/**' | ||
|
|
||
| jobs: | ||
| sec: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| # From https://github.com/marketplace/actions/setup-oss-cad-suite | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install FuseSoC from lowRISC | ||
| run: | | ||
| python3 -m venv venv_cve2/ | ||
| source venv_cve2/bin/activate | ||
| python -m pip install --upgrade pip | ||
| python -m pip install --upgrade -r python-requirements.txt | ||
| # Make the venv tools available to subsequent steps | ||
| echo "$PWD/venv_cve2/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Check FuseSoC version | ||
| run: | | ||
| echo "which fusesoc: $(which fusesoc || true)" | ||
| fusesoc --version || echo "fusesoc not found or failed to run" | ||
|
|
||
| - name: Install OSS CAD Suite | ||
| uses: YosysHQ/setup-oss-cad-suite@v3 | ||
|
|
||
| - name: Check Yosys version | ||
| run: yosys --version || true | ||
|
|
||
| - name: Run SEC on the standard core configuration | ||
| run: make sec | ||
|
|
||
| - name: Run SEC on the eXtension InterFace configuration | ||
| run: make sec_XInterface | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Copyright (c) 2025 Eclipse Foundation | ||
| # | ||
| # Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://solderpad.org/licenses/ | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
|
|
||
| # sec.tcl is an aux Tcl script used to compile RTL files with parameters, | ||
| # passed as env vars, with Yosys. | ||
| # This script is called by the Yosys EQY script sec.eqy | ||
| # | ||
| # Currently the only parameter supported is the CV-X-IF interface | ||
| # (XInterface=1) | ||
|
|
||
| yosys plugin -i slang | ||
|
|
||
| # GOLD or GATE | ||
| set DESIGN [lindex $argv 0] | ||
| set XInterface $::env(XInterface) | ||
|
|
||
| puts "Compiling the $DESIGN design" | ||
| puts "XInterface: $XInterface" | ||
|
|
||
|
|
||
| # Conditional logic based on its value | ||
| if {$DESIGN eq "GOLD"} { | ||
| puts "Running GOLD flow" | ||
|
|
||
| yosys read_slang --ignore-assertions -D$DESIGN -DXInterface=$XInterface --top cve2_top -f ./golden.src | ||
|
|
||
| if {$XInterface eq 0} { | ||
| # Exclude specifically the top IO CV-X-IF signals from analysis | ||
| yosys select -set x_interface_set o:\x_* i:\x_* | ||
| yosys delete @x_interface_set | ||
| } | ||
|
|
||
| # Save the list of IO signals, in case the new revised version is different | ||
| yosys select -write yosys/golden_io.txt o:* i:* | ||
|
|
||
| } elseif {$DESIGN eq "GATE"} { | ||
| puts "Running GATE flow" | ||
|
|
||
| yosys read_slang --ignore-assertions -D$DESIGN -DXInterface=$XInterface --top cve2_top -f ./revised.src | ||
|
|
||
| # Delete eventual new IO ports from the revised design from analysis, as we | ||
| # cannot compare designs with different sets of IO ports | ||
|
|
||
|
|
||
| for {set i 10} {$i >= 0} {incr i -1} { | ||
| if {[file exists "yosys/golden_io.txt"]} { | ||
| break | ||
| } else { | ||
| puts "Attempt [ expr 10-$i+1 ]: File not found" | ||
| if {$i > 0} { | ||
| after 50 | ||
| } else { | ||
| puts "yosys/golden_io.txt not found after 10 attempts" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| yosys select -set golden_io -read yosys/golden_io.txt | ||
| yosys select -set revised_io o:* i:* | ||
| yosys select -set excl_sigs @revised_io @golden_io %d | ||
| yosys delete @excl_sigs | ||
| yosys select -write yosys/revised_io.txt o:* i:* | ||
|
|
||
| } else { | ||
| error "Wrong first argument: $DESIGN. Only GOLD or GATE are accepted" | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.