| # Copyright lowRISC contributors. | |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| load("@lowrisc_opentitan//rules:autogen.bzl", "autogen_hjson_header") | |
| load("//rules:autogen.bzl", "autogen_top_gen_hjson") | |
| package(default_visibility = ["//visibility:public"]) | |
| autogen_hjson_header( | |
| name = "rv_plic_regs", | |
| srcs = [ | |
| "ip_autogen/rv_plic/data/rv_plic.hjson", | |
| ], | |
| ) | |
| autogen_hjson_header( | |
| name = "rv_plic_smc_regs", | |
| srcs = [ | |
| "ip_autogen/rv_plic_smc/data/rv_plic_smc.hjson", | |
| ], | |
| ) | |
| autogen_hjson_header( | |
| name = "alert_handler_regs", | |
| srcs = [ | |
| "ip_autogen/alert_handler/data/alert_handler.hjson", | |
| ], | |
| ) | |
| # Need to add the template and hjson files to the data to support topgen_matcha. | |
| # This rule assumes all the top_matcha hjson files are already up-to-date. | |
| autogen_top_gen_hjson( | |
| name = "top_gen_rom_ctrl_hjson", | |
| srcs = "//hw/top_matcha/data:top_matcha.hjson", | |
| data = [ | |
| ":all_hjson_files", | |
| "@lowrisc_opentitan//hw:all_files", | |
| ], | |
| output = "data/autogen/top_matcha.gen.rom_ctrl.hjson", | |
| ) | |
| filegroup( | |
| name = "all_files", | |
| srcs = glob(["**"]) + [ | |
| "//hw/ip:all_files", | |
| "//hw/top_matcha/data:all_files", | |
| "//hw/top_matcha/dv:all_files", | |
| "//hw/top_matcha/ip:all_files", | |
| "//hw/top_matcha/sw:all_files", | |
| ], | |
| ) | |
| filegroup( | |
| name = "all_hjson_files", | |
| srcs = glob(["ip_autogen/**/*.hjson"]) + [ | |
| "//hw/ip:all_hjson_files", | |
| "//hw/top_matcha/data:all_hjson_files", | |
| "//hw/top_matcha/ip:all_hjson_files", | |
| ], | |
| ) | |
| cc_library( | |
| name = "alert_handler_regs_h", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:alert_handler_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha:alert_handler_regs", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "ast_regs", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:ip/ast/data/ast_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha/ip/ast/data", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha/ip/ast/data:ast_regs", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "clkmgr_regs", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:ip/clkmgr/data/autogen/clkmgr_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha/ip/clkmgr/data/autogen", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha/ip/clkmgr/data/autogen:clkmgr_regs", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "pinmux_regs", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:ip/pinmux/data/autogen/pinmux_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha/ip/pinmux/data/autogen", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha/ip/pinmux/data/autogen:pinmux_regs", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "rv_plic_regs_h", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:rv_plic_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha:rv_plic_regs", | |
| ], | |
| }), | |
| ) | |
| cc_library( | |
| name = "rv_plic_smc_regs_h", | |
| hdrs = select({ | |
| "//rules:sparrow_platform": [ | |
| "//hw/top_matcha/sparrow/hw/top_matcha:rv_plic_smc_regs.h", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| includes = select({ | |
| "//rules:sparrow_platform": [ | |
| "sparrow/hw/top_matcha", | |
| ], | |
| "//conditions:default": [], | |
| }), | |
| deps = select({ | |
| "//rules:sparrow_platform": [ | |
| ], | |
| "//conditions:default": [ | |
| "//hw/top_matcha:rv_plic_smc_regs", | |
| ], | |
| }), | |
| ) |