Commit 318de593 authored by John Zacarias Jekel's avatar John Zacarias Jekel
Browse files

Setup lint and fix fullchip synthesis

- Uses the `svlint` tool
- Still want to setup xsim and vsim linting too
- Need to fix Verilator lint errors that don't show up in sim but do here...
parent b5af77f9
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
name: LETC Lint

#Thanks https://stackoverflow.com/questions/57699839/github-actions-how-to-target-all-branches-except-master
on:
  push:
    branches: [ "**", "!legacy" ]
  pull_request:
    branches: [ "**", "!legacy" ]

jobs:
  svlint:
    strategy:
      fail-fast: false
      matrix:
        #We only support Linux
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}

    timeout-minutes: 120

    steps:
      - uses: actions/checkout@v3

      - name: Cache svlint Installation
        id: cache-svlint
        uses: actions/cache@v3
        env:
          cache-name: cache-svlint-installation
        with:
          path: ~/.cargo
          key: ${{runner.os}}-build-${{env.cache-name}}

      - if: ${{ steps.cache-svlint.outputs.cache-hit != 'true' }}
        name: Install svlint Compile Dependencies
        run: sudo apt-get install cargo

      - if: ${{ steps.cache-svlint.outputs.cache-hit != 'true' }}
        name: Compile svlint
        run: cargo install svlint

      - name: Run svlint
        working-directory: ${{github.workspace}}/lint
        run: |
          . "$HOME/.cargo/env"
          ./svlint.sh

.svlint.toml

0 → 100644
+47 −0
Original line number Diff line number Diff line
# .svlint.toml
# Copyright (C) 2024 John Jekel
# See the LICENSE file at the root of the project for licensing info.
#
# svlint configuration file for LETC

[option]
prefix_input    = "i_"
prefix_output   = "o_"

[textrules]
style_directives    = true
style_semicolon     = true
#style_indent = true

[syntaxrules]
action_block_with_side_effect               = true
blocking_assignment_in_always_at_edge       = true
blocking_assignment_in_always_ff            = true
blocking_assignment_in_always_latch         = true
#default_nettype_none                        = true#Vivado is incompatible with this
enum_with_type                              = true
function_same_as_system_function            = true
general_always_level_sensitive              = true
general_always_no_edge                      = true
genvar_declaration_in_loop                  = true
interface_port_with_modport                 = true
keyword_forbidden_always                    = true
keyword_forbidden_always_latch              = true
keyword_forbidden_wire_reg                  = true
keyword_required_generate                   = true
#localparam_explicit_type                    = true#Honestly not that important
loop_variable_declaration                   = true
module_nonansi_forbidden                    = true
multiline_for_begin                         = true
multiline_if_begin                          = true
non_blocking_assignment_in_always_comb      = true
non_blocking_assignment_in_always_no_edge   = true
operator_case_equality                      = true
package_item_not_in_package                 = true
#parameter_explicit_type                     = true#Honestly not that important
procedural_continuous_assignment            = true
prefix_input                                = true
prefix_output                               = true
#The space ones are too aggressive
style_trailingwhitespace                    = true
tab_character                               = true
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
The Little Engine That Could (Run Linux) :)

[![LETC Non-UVM Tests](https://github.com/angry-goose-initiative/letc/actions/workflows/nonuvm_tests.yml/badge.svg?branch=main)](https://github.com/angry-goose-initiative/letc/actions/workflows/nonuvm_tests.yml)
[![LETC Lint](https://github.com/angry-goose-initiative/letc/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/angry-goose-initiative/letc/actions/workflows/lint.yml)

## Lore

lint/filelist.f

0 → 100644
+43 −0
Original line number Diff line number Diff line
# filelist.f
# Copyright (C) 2024 John Jekel
# See the LICENSE file at the root of the project for licensing info.
#
# Lint file list

rtl/common/fifo/fifo_0r0w.sv
rtl/common/fifo/fifo_0r1w.sv
rtl/common/fifo/fifo_1r1w.sv
rtl/common/cdc/cdc_synchronizer.sv
rtl/common/axi/axi_pkg.sv
rtl/common/axi/axi_if.sv
rtl/common/axi/axi_buffer.sv

rtl/letc/letc_pkg.sv
rtl/letc/letc_top.sv

rtl/letc/core/letc_core_pkg.sv
rtl/letc/core/letc_core_top.sv
rtl/letc/core/letc_core_rf.sv
rtl/letc/core/letc_core_stage_f1.sv
rtl/letc/core/letc_core_stage_f2.sv
rtl/letc/core/letc_core_stage_d.sv
rtl/letc/core/letc_core_stage_e1.sv
rtl/letc/core/letc_core_stage_e2.sv
rtl/letc/core/letc_core_stage_w.sv
rtl/letc/core/letc_core_tghm.sv
rtl/letc/core/letc_core_cache.sv
rtl/letc/core/letc_core_tlb.sv
rtl/letc/core/letc_core_mmu.sv
rtl/letc/core/letc_core_csr.sv
rtl/letc/core/letc_core_limp_if.sv
rtl/letc/core/letc_core_cache_if.sv
rtl/letc/core/letc_core_tlb_if.sv
rtl/letc/core/letc_core_axi_fsm.sv

rtl/letc/matrix/letc_matrix_top.sv
rtl/letc/matrix/letc_matrix_switch.sv
rtl/letc/matrix/letc_matrix_default_subordinate.sv

#We have to break convention here since we interact with AMD IP
#TODO fine-grained waivers
#rtl/fpga_wrapper/coraz7_top.sv

lint/svlint.sh

0 → 100755
+13 −0
Original line number Diff line number Diff line
#!/bin/bash
# Copyright (C) 2024 John Jekel
# See the LICENSE file at the root of the project for licensing info.
#
# Lint All The Things!
#
# Should be run from the lint directory

# Exit on error immediately
set -e

cd ..
svlint -D SIMULATION -f lint/filelist.f
Loading