Skip to content
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

Fix linter #178

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
jobs:
buildifier:
runs-on: ubuntu-20.04

env:
BUILDIFIER_VERSION: v6.3.3
steps:
- uses: actions/checkout@v2

- run: sudo wget https://github.com/bazelbuild/buildtools/releases/latest/download/buildifier-linux-amd64 -O /usr/local/bin/buildifier
- run: sudo wget https://github.com/bazelbuild/buildtools/releases/download/${{env.BUILDIFIER_VERSION}}/buildifier-linux-amd64 -O /usr/local/bin/buildifier
- run: sudo chmod +x /usr/local/bin/buildifier

- run: buildifier -lint warn -r .
2 changes: 1 addition & 1 deletion cocotb/cocotb.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Rules for running tests using Cocotb framework"""

load("//verilog:providers.bzl", "VerilogInfo")
load("@rules_python//python:defs.bzl", "PyInfo")
load("//verilog:providers.bzl", "VerilogInfo")

## Helpers for parsing arguments

Expand Down
2 changes: 1 addition & 1 deletion cocotb/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_hdl_pip_deps//:requirements.bzl", "requirement")
load("//cocotb:cocotb.bzl", "cocotb_test")
load("//verilog:providers.bzl", "verilog_library")
load("@rules_hdl_pip_deps//:requirements.bzl", "requirement")

verilog_library(
name = "counter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Internal helper function that is used by the BUILD files for each
cell library workspace to set things up."""

load(":cell_libraries.bzl", "CELL_LIBRARIES")
load("@rules_hdl//dependency_support/com_google_skywater_pdk:build_defs.bzl", "skywater_cell_library", "skywater_corner")
load(":cell_libraries.bzl", "CELL_LIBRARIES")

def declare_cell_library(workspace_name, name):
"""This should be called from the BUILD file of a cell library workspace. It sets up the targets for the generated files of the given library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ load("//pdk:open_road_configuration.bzl", "open_road_pdk_configuration")

exports_files([
"pdk.patch",
"fill.json", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/fill.json
"sky130hd.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/sky130hd.lyt
"fill.json", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/fill.json
"sky130hd.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/sky130hd/sky130hd.lyt
])

open_road_pdk_configuration(
Expand Down
2 changes: 1 addition & 1 deletion dependency_support/dependency_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ load("@rules_hdl//dependency_support/at_clifford_icestorm:at_clifford_icestorm.b
load("@rules_hdl//dependency_support/at_clifford_yosys:at_clifford_yosys.bzl", "at_clifford_yosys")
load("@rules_hdl//dependency_support/bazel_skylib:bazel_skylib.bzl", "bazel_skylib")
load("@rules_hdl//dependency_support/boost:boost.bzl", "boost")
load("@rules_hdl//dependency_support/com_icarus_iverilog:com_icarus_iverilog.bzl", "com_icarus_iverilog")
load("@rules_hdl//dependency_support/com_github_fmtlib_fmt:com_github_fmtlib_fmt.bzl", "com_github_fmtlib_fmt")
load("@rules_hdl//dependency_support/com_github_gabime_spdlog:com_github_gabime_spdlog.bzl", "com_github_gabime_spdlog")
load("@rules_hdl//dependency_support/com_github_libbacktrace:com_github_libbacktrace.bzl", "com_github_libbacktrace")
Expand All @@ -35,6 +34,7 @@ load("@rules_hdl//dependency_support/com_github_yosyshq_prjtrellis_db:com_github
load("@rules_hdl//dependency_support/com_google_absl:com_google_absl.bzl", "com_google_absl")
load("@rules_hdl//dependency_support/com_google_googletest:com_google_googletest.bzl", "com_google_googletest")
load("@rules_hdl//dependency_support/com_google_skywater_pdk:com_google_skywater_pdk.bzl", "com_google_skywater_pdk")
load("@rules_hdl//dependency_support/com_icarus_iverilog:com_icarus_iverilog.bzl", "com_icarus_iverilog")
load("@rules_hdl//dependency_support/com_opencircuitdesign_magic:com_opencircuitdesign_magic.bzl", "com_opencircuitdesign_magic")
load("@rules_hdl//dependency_support/com_opencircuitdesign_netgen:com_opencircuitdesign_netgen.bzl", "com_opencircuitdesign_netgen")
load("@rules_hdl//dependency_support/edu_berkeley_abc:edu_berkeley_abc.bzl", "edu_berkeley_abc")
Expand Down
2 changes: 1 addition & 1 deletion dependency_support/org_theopenroadproject_asap7/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ exports_files([
"tracks.tcl",
"rc_script.tcl",
"pdn_config.pdn",
"asap7.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/asap7/KLayout/asap7.lyt
"asap7.lyt", # Imported from OpenROAD-flow-scripts on 24.07.2023 at 6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8 from: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/6ec980e1d49a1a8dcdd1e25ed81255b4bb8285c8/flow/platforms/asap7/KLayout/asap7.lyt
])
2 changes: 1 addition & 1 deletion flows/analysis/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

"""Design analysis utilities written using modular hardware flows."""

load("@rules_hdl//pdk:build_defs.bzl", "StandardCellInfo")
load("//flows:flows.bzl", "flow_binary", "tcl_script_prefix")
load("//flows/openroad:build_defs.bzl", "assemble_openroad_step", "read_standard_cells")
load("//flows/yosys:build_defs.bzl", "yosys_synth_file_step")
load("@rules_hdl//pdk:build_defs.bzl", "StandardCellInfo")

def _analyze_netlist_step_impl(ctx):
tcl_commands = [tcl_script_prefix]
Expand Down
2 changes: 1 addition & 1 deletion flows/openroad/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Reimplementing place-and-route using composable and externalizable pieces"""

load("//flows:flows.bzl", "FlowStepInfo", "script_prefix")
load("@rules_hdl//pdk:build_defs.bzl", "StandardCellInfo")
load("//flows:flows.bzl", "FlowStepInfo", "script_prefix")

def assemble_openroad_step(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion flows/yosys/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Reimplementing place-and-route using composable and externalizable pieces"""

load("//flows:flows.bzl", "FlowStepInfo", "script_prefix")
load("@rules_hdl//pdk:build_defs.bzl", "StandardCellInfo")
load("//flows:flows.bzl", "FlowStepInfo", "script_prefix")

def _yosys_synth_file_step_impl(ctx):
yosys_executable = ctx.attr._yosys.files_to_run.executable
Expand Down
2 changes: 1 addition & 1 deletion gds_write/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

"""These build rules run automated GDS write on an implemented design"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "assert_has_open_road_configuration", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo")
load("//synthesis:build_defs.bzl", "SynthesisInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "assert_has_open_road_configuration", "get_open_road_configuration")

def _gds_write_impl(ctx):
# Throws an error if there is no OpenROAD configuration
Expand Down
12 changes: 6 additions & 6 deletions place_and_route/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

"""These build rules run automated place and route on a synthesized netlist"""

load("//synthesis:build_defs.bzl", "SynthesisInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "assert_has_open_road_configuration")
load("//place_and_route:private/clock_tree_synthesis.bzl", "clock_tree_synthesis")
load("//place_and_route:private/detailed_routing.bzl", "detailed_routing")
load("//place_and_route:private/floorplan.bzl", "init_floor_plan")
load("//place_and_route:private/place_pins.bzl", "place_pins")
load("//place_and_route:private/pdn_gen.bzl", "pdn_gen")
load("//place_and_route:private/global_placement.bzl", "global_placement")
load("//place_and_route:private/resize.bzl", "resize")
load("//place_and_route:private/clock_tree_synthesis.bzl", "clock_tree_synthesis")
load("//place_and_route:private/global_routing.bzl", "global_routing")
load("//place_and_route:private/detailed_routing.bzl", "detailed_routing")
load("//place_and_route:private/pdn_gen.bzl", "pdn_gen")
load("//place_and_route:private/place_pins.bzl", "place_pins")
load("//place_and_route:private/resize.bzl", "resize")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def _place_and_route_impl(ctx):
# Throws an error if there is no OpenROAD configuration
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/clock_tree_synthesis.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

"""Clock Tree Synthesis openROAD commands"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "format_openroad_do_not_use_list", "merge_open_road_info", "openroad_command", "placement_padding_commands", "timing_setup_commands")
load("//synthesis:build_defs.bzl", "SynthesisInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")

def clock_tree_synthesis(ctx, open_road_info):
"""Performs clock tree synthesis.
Expand Down
6 changes: 3 additions & 3 deletions place_and_route/private/detailed_routing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Detailed Routing openROAD commands"""

load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("@rules_hdl//pdk:open_road_configuration.bzl", "DetailedRoutingInfo", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def detailed_routing(ctx, open_road_info):
Expand Down Expand Up @@ -59,9 +59,9 @@ def detailed_routing(ctx, open_road_info):
open_road_commands.append("detailed_route -output_drc {} {}".format(output_drc.path, detailed_routing_args))
density_fill_config = None
if open_road_configuration.density_fill_config:
density_fill_config = open_road_configuration.density_fill_config.files.to_list()[0]
density_fill_config = open_road_configuration.density_fill_config.files.to_list()[0]
if ctx.file.density_fill_config:
density_fill_config = ctx.file.density_fill_config
density_fill_config = ctx.file.density_fill_config

if density_fill_config:
open_road_commands.append("set db [ord::get_db]")
Expand Down
4 changes: 2 additions & 2 deletions place_and_route/private/floorplan.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

"""Floorplaning openROAD commands"""

load("//place_and_route:open_road.bzl", "OpenRoadInfo", "openroad_command")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//synthesis:build_defs.bzl", "SynthesisInfo")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "openroad_command")
load("//place_and_route:private/report_area.bzl", "generate_area_results")
load("//place_and_route:private/report_power.bzl", "generate_power_results")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def _initialize_floorplan_command(ctx):
open_road_configuration = get_open_road_configuration(ctx.attr.synthesized_rtl[SynthesisInfo])
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/global_placement.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Global placement openROAD commands"""

load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def global_placement(ctx, open_road_info):
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/pdn_gen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""PDN openROAD commands"""

load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def pdn_gen(ctx, open_road_info):
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/place_pins.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"""Pin Placement openROAD commands"""

load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "timing_setup_commands")
load("//synthesis:build_defs.bzl", "SynthesisInfo")

def place_pins(ctx, open_road_info):
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/resize.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

"""Resize openROAD commands"""

load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")
load("//place_and_route:open_road.bzl", "OpenRoadInfo", "format_openroad_do_not_use_list", "merge_open_road_info", "openroad_command", "placement_padding_commands", "timing_setup_commands")
load("//synthesis:build_defs.bzl", "SynthesisInfo")
load("@rules_hdl//pdk:open_road_configuration.bzl", "get_open_road_configuration")

def resize(ctx, open_road_info):
"""Performs resizing operation of the standard cells.
Expand Down
6 changes: 3 additions & 3 deletions synthesis/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("//synthesis:build_defs.bzl", "synthesize_rtl")
load("//static_timing:build_defs.bzl", "run_opensta")
load("//place_and_route:build_defs.bzl", "place_and_route")
load("//gds_write:build_defs.bzl", "gds_write")
load("//place_and_route:build_defs.bzl", "place_and_route")
load("//static_timing:build_defs.bzl", "run_opensta")
load("//synthesis:build_defs.bzl", "synthesize_rtl")
load("//verilog:providers.bzl", "verilog_library")

synthesize_rtl(
Expand Down
2 changes: 1 addition & 1 deletion toolchains/cpython/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_python//python:defs.bzl", "py_runtime")
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
load("@rules_python//python:defs.bzl", "py_runtime")

py_runtime(
name = "cpython_runtime",
Expand Down
2 changes: 1 addition & 1 deletion tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_hdl_pip_deps//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary")

py_binary(
name = "report_status_to_github",
Expand Down
2 changes: 1 addition & 1 deletion verilator/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

"""Functions for verilator."""

load("//verilog:providers.bzl", "VerilogInfo")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("//verilog:providers.bzl", "VerilogInfo")

def cc_compile_and_link_static_library(ctx, srcs, hdrs, deps, runfiles, includes = [], defines = []):
"""Compile and link C++ source into a static library
Expand Down
2 changes: 1 addition & 1 deletion verilator/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//verilog:providers.bzl", "verilog_library")
load("//verilator:defs.bzl", "verilator_cc_library")
load("//verilog:providers.bzl", "verilog_library")

verilog_library(
name = "adder",
Expand Down
2 changes: 1 addition & 1 deletion vivado/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//verilog:providers.bzl", "verilog_library")
load("//verilator:defs.bzl", "verilator_cc_library")
load("//verilog:providers.bzl", "verilog_library")
load(
"//vivado:defs.bzl",
"vivado_create_ip",
Expand Down
Loading