Timothy Trippel | 84c0e48 | 2022-03-24 16:17:52 -0700 | [diff] [blame] | 1 | # Copyright lowRISC contributors. |
| 2 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | load("@rules_python//python:defs.bzl", "py_binary") |
| 6 | load("@ot_python_deps//:requirements.bzl", "requirement") |
| 7 | |
| 8 | package(default_visibility = ["//visibility:public"]) |
| 9 | |
| 10 | py_library( |
| 11 | name = "utils", |
| 12 | srcs = ["utils.py"], |
| 13 | deps = [ |
| 14 | requirement("hjson"), |
| 15 | requirement("mistletoe"), |
| 16 | requirement("premailer"), |
| 17 | ], |
| 18 | ) |
| 19 | |
| 20 | py_library( |
| 21 | name = "sim_utils", |
| 22 | srcs = ["sim_utils.py"], |
| 23 | ) |
| 24 | |
| 25 | py_library( |
| 26 | name = "msg_buckets", |
| 27 | srcs = [ |
| 28 | "MsgBucket.py", |
| 29 | "MsgBuckets.py", |
| 30 | ], |
| 31 | deps = [ |
| 32 | ":utils", |
| 33 | ], |
| 34 | ) |
| 35 | |
| 36 | py_library( |
| 37 | name = "modes", |
| 38 | srcs = ["Modes.py"], |
| 39 | deps = [ |
| 40 | ":utils", |
| 41 | ], |
| 42 | ) |
| 43 | |
| 44 | py_library( |
| 45 | name = "timer", |
| 46 | srcs = ["Timer.py"], |
| 47 | ) |
| 48 | |
| 49 | py_library( |
| 50 | name = "status_printer", |
| 51 | srcs = ["StatusPrinter.py"], |
| 52 | deps = [ |
| 53 | requirement("enlighten"), |
| 54 | ], |
| 55 | ) |
| 56 | |
| 57 | py_library( |
| 58 | name = "launcher", |
| 59 | srcs = [ |
| 60 | "Launcher.py", |
| 61 | "LauncherFactory.py", |
| 62 | "LocalLauncher.py", |
| 63 | "LsfLauncher.py", |
| 64 | ], |
| 65 | deps = [ |
| 66 | ":utils", |
| 67 | ], |
| 68 | ) |
| 69 | |
| 70 | py_library( |
| 71 | name = "deploy", |
| 72 | srcs = ["Deploy.py"], |
| 73 | deps = [ |
| 74 | ":launcher", |
| 75 | ":sim_utils", |
| 76 | ":utils", |
| 77 | requirement("tabulate"), |
| 78 | ], |
| 79 | ) |
| 80 | |
| 81 | py_library( |
| 82 | name = "scheduler", |
| 83 | srcs = ["Scheduler.py"], |
| 84 | deps = [ |
| 85 | ":launcher", |
| 86 | ":status_printer", |
| 87 | ":timer", |
| 88 | ":utils", |
| 89 | ], |
| 90 | ) |
| 91 | |
| 92 | py_library( |
| 93 | name = "cfg_json", |
| 94 | srcs = ["CfgJson.py"], |
| 95 | deps = [ |
| 96 | ":utils", |
| 97 | ], |
| 98 | ) |
| 99 | |
| 100 | py_library( |
| 101 | name = "flow_cfg", |
| 102 | srcs = ["FlowCfg.py"], |
| 103 | deps = [ |
| 104 | ":cfg_json", |
| 105 | ":launcher", |
| 106 | ":scheduler", |
| 107 | ":utils", |
| 108 | requirement("hjson"), |
| 109 | ], |
| 110 | ) |
| 111 | |
| 112 | py_library( |
| 113 | name = "oneshot_cfg", |
| 114 | srcs = ["OneShotCfg.py"], |
| 115 | deps = [ |
| 116 | ":deploy", |
| 117 | ":flow_cfg", |
| 118 | ":modes", |
| 119 | ":utils", |
| 120 | ], |
| 121 | ) |
| 122 | |
| 123 | py_library( |
| 124 | name = "lint_cfg", |
| 125 | srcs = ["LintCfg.py"], |
| 126 | deps = [ |
| 127 | ":msg_buckets", |
| 128 | ":oneshot_cfg", |
| 129 | ":utils", |
| 130 | requirement("tabulate"), |
| 131 | ], |
| 132 | ) |
| 133 | |
| 134 | py_library( |
| 135 | name = "formal_cfg", |
| 136 | srcs = ["FormalCfg.py"], |
| 137 | deps = [ |
| 138 | ":oneshot_cfg", |
| 139 | ":utils", |
| 140 | requirement("hjson"), |
| 141 | requirement("tabulate"), |
| 142 | ], |
| 143 | ) |
| 144 | |
| 145 | py_library( |
| 146 | name = "cdc_cfg", |
| 147 | srcs = ["CdcCfg.py"], |
| 148 | deps = [ |
| 149 | ":lint_cfg", |
| 150 | ":msg_buckets", |
| 151 | ":utils", |
| 152 | requirement("tabulate"), |
| 153 | ], |
| 154 | ) |
| 155 | |
| 156 | py_library( |
| 157 | name = "testplan", |
| 158 | srcs = ["Testplan.py"], |
| 159 | deps = [ |
| 160 | requirement("hjson"), |
| 161 | requirement("mistletoe"), |
| 162 | requirement("tabulate"), |
| 163 | ], |
| 164 | ) |
| 165 | |
| 166 | py_library( |
| 167 | name = "sim_results", |
| 168 | srcs = ["SimResults.py"], |
| 169 | deps = [ |
| 170 | ":testplan", |
| 171 | ], |
| 172 | ) |
| 173 | |
| 174 | py_library( |
| 175 | name = "sim_cfg", |
| 176 | srcs = ["SimCfg.py"], |
| 177 | deps = [ |
| 178 | ":deploy", |
| 179 | ":flow_cfg", |
| 180 | ":modes", |
| 181 | ":sim_results", |
| 182 | ":testplan", |
| 183 | ":utils", |
| 184 | requirement("tabulate"), |
| 185 | ], |
| 186 | ) |
| 187 | |
| 188 | py_library( |
| 189 | name = "syn_cfg", |
| 190 | srcs = ["SynCfg.py"], |
| 191 | deps = [ |
| 192 | ":oneshot_cfg", |
| 193 | ":utils", |
| 194 | requirement("hjson"), |
| 195 | requirement("tabulate"), |
| 196 | ], |
| 197 | ) |
| 198 | |
| 199 | py_library( |
| 200 | name = "cfg_factory", |
| 201 | srcs = ["CfgFactory.py"], |
| 202 | deps = [ |
| 203 | ":cdc_cfg", |
| 204 | ":cfg_json", |
| 205 | ":formal_cfg", |
| 206 | ":lint_cfg", |
| 207 | ":sim_cfg", |
| 208 | ":syn_cfg", |
| 209 | ], |
| 210 | ) |
| 211 | |
| 212 | py_binary( |
| 213 | name = "dvsim", |
| 214 | srcs = ["dvsim.py"], |
| 215 | deps = [ |
| 216 | ":cfg_factory", |
| 217 | ":deploy", |
| 218 | ":launcher", |
| 219 | ":timer", |
| 220 | ":utils", |
| 221 | ], |
| 222 | ) |