Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update synthesis.yml #23

Merged
merged 1 commit into from
Feb 5, 2025
Merged

Update synthesis.yml #23

merged 1 commit into from
Feb 5, 2025

Conversation

ewdlop
Copy link
Owner

@ewdlop ewdlop commented Feb 5, 2025

name: Synthesize Verilog Modules

on:
  push:
    branches:
      - main  # You can specify your main branch or all branches
  pull_request:
    branches:
      - main  # Runs for pull requests targeting the main branch

jobs:
  synthesize:
    runs-on: ubuntu-latest  # The environment to run the job on

    steps:
      # Step 1: Check out the repository
      - name: Checkout repository
        uses: actions/checkout@v2

      # Step 2: Set up Yosys synthesis tool
      - name: Install Yosys
        run: |
          sudo apt update
          sudo apt install -y build-essential clang bison flex libreadline-dev \
          git gawk tcl zlib1g-dev
          git clone --recursive https://github.com/YosysHQ/yosys
          cd yosys
          make
          sudo make install

      # Step 3: Run Yosys on Verilog files to check for synthesis errors
      - name: Run Yosys Synthesis
        run: |
          yosys -p "read_verilog $(find . -name '*.v'); synth -top top_module" > synthesis_log.txt
          cat synthesis_log.txt

      # Step 4: Check if synthesis was successful
      - name: Check synthesis log for errors
        run: |
          if grep -q "error" synthesis_log.txt; then
            echo "Synthesis failed. Check synthesis_log.txt for errors."
            exit 1
          else
            echo "Synthesis successful!"
          fi

```yml
name: Synthesize Verilog Modules

on:
  push:
    branches:
      - main  # You can specify your main branch or all branches
  pull_request:
    branches:
      - main  # Runs for pull requests targeting the main branch

jobs:
  synthesize:
    runs-on: ubuntu-latest  # The environment to run the job on

    steps:
      # Step 1: Check out the repository
      - name: Checkout repository
        uses: actions/checkout@v2

      # Step 2: Set up Yosys synthesis tool
      - name: Install Yosys
        run: |
          sudo apt update
          sudo apt install -y build-essential clang bison flex libreadline-dev \
          git gawk tcl zlib1g-dev
          git clone --recursive https://github.com/YosysHQ/yosys
          cd yosys
          make
          sudo make install

      # Step 3: Run Yosys on Verilog files to check for synthesis errors
      - name: Run Yosys Synthesis
        run: |
          yosys -p "read_verilog $(find . -name '*.v'); synth -top top_module" > synthesis_log.txt
          cat synthesis_log.txt

      # Step 4: Check if synthesis was successful
      - name: Check synthesis log for errors
        run: |
          if grep -q "error" synthesis_log.txt; then
            echo "Synthesis failed. Check synthesis_log.txt for errors."
            exit 1
          else
            echo "Synthesis successful!"
          fi
```
Copy link

codesandbox bot commented Feb 5, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@ewdlop ewdlop merged commit 0e8b60c into main Feb 5, 2025
1 check failed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant