Skip to content

Commit

Permalink
Move delay model related utilities from xls/tools to xls/estimators/d…
Browse files Browse the repository at this point in the history
…elay_model.

PiperOrigin-RevId: 674456040
  • Loading branch information
meheffernan authored and copybara-github committed Sep 13, 2024
1 parent 53c10ca commit e5e5eb1
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 66 deletions.
2 changes: 1 addition & 1 deletion xls/build_rules/xls_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ currently produced should be considered INCOMPLETE.""",
cfg = "target",
),
"_run_op_characterization": attr.label(
default = Label("//xls/tools:run_op_characterization"),
default = Label("//xls/estimators:run_op_characterization"),
executable = True,
cfg = "target",
),
Expand Down
51 changes: 51 additions & 0 deletions xls/estimators/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,54 @@ py_test(
"@com_google_absl_py//absl/testing:absltest",
],
)

py_binary(
name = "estimator_model_stats",
srcs = ["estimator_model_stats.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
requirement("numpy"),
"//xls/estimators:estimator_model",
"//xls/estimators:estimator_model_py_pb2",
"@com_google_absl_py//absl:app",
"@com_google_absl_py//absl/flags",
"@com_google_absl_py//absl/logging",
"@com_google_protobuf//:protobuf_python",
],
)

py_test(
name = "estimator_model_stats_test",
srcs = ["estimator_model_stats_test.py"],
data = [
"testdata/asap7_delay_data_points.textproto",
"testdata/asap7_delay_model_stats.csv",
"testdata/sky130_delay_data_points.textproto",
"testdata/sky130_delay_model_stats.csv",
"testdata/unit_delay_data_points.textproto",
"testdata/unit_delay_model_stats.csv",
":estimator_model_stats",
],
python_version = "PY3",
srcs_version = "PY3",
tags = ["nomsan"], # scipy seems not to be msan-clean.
deps = [
"//xls/common:runfiles",
"//xls/common:test_base",
"@com_google_absl_py//absl/testing:absltest",
],
)

py_binary(
name = "run_op_characterization",
srcs = ["run_op_characterization.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
requirement("portpicker"),
"@com_google_absl_py//absl:app",
"@com_google_absl_py//absl/flags",
"@com_google_absl_py//absl/logging",
],
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for xls/tools/estimator_model_stats.py."""
"""Tests for xls/estimators/estimator_model_stats.py."""

import filecmp
import subprocess
Expand All @@ -21,25 +21,25 @@
from xls.common import runfiles

_ESTIMATOR_MODEL_STATS_PATH = runfiles.get_path(
'xls/tools/estimator_model_stats'
'xls/estimators/estimator_model_stats'
)
_ASAP7_DELAY_DATA_POINTS_PATH = runfiles.get_path(
'xls/tools/testdata/asap7_delay_data_points.textproto'
'xls/estimators/testdata/asap7_delay_data_points.textproto'
)
_ASAP7_DELAY_MODEL_STATS_PATH = runfiles.get_path(
'xls/tools/testdata/asap7_delay_model_stats.csv'
'xls/estimators/testdata/asap7_delay_model_stats.csv'
)
_SKY130_DELAY_DATA_POINTS_PATH = runfiles.get_path(
'xls/tools/testdata/sky130_delay_data_points.textproto'
'xls/estimators/testdata/sky130_delay_data_points.textproto'
)
_SKY130_DELAY_MODEL_STATS_PATH = runfiles.get_path(
'xls/tools/testdata/sky130_delay_model_stats.csv'
'xls/estimators/testdata/sky130_delay_model_stats.csv'
)
_UNIT_DELAY_DATA_POINTS_PATH = runfiles.get_path(
'xls/tools/testdata/unit_delay_data_points.textproto'
'xls/estimators/testdata/unit_delay_data_points.textproto'
)
_UNIT_DELAY_MODEL_STATS_PATH = runfiles.get_path(
'xls/tools/testdata/unit_delay_model_stats.csv'
'xls/estimators/testdata/unit_delay_model_stats.csv'
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for xls.tools.extract_samples_from_estimator_model."""
"""Tests for xls.estimators.extract_samples_from_estimator_model."""

import subprocess

Expand Down
File renamed without changes.
56 changes: 0 additions & 56 deletions xls/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -856,19 +856,6 @@ py_test(
],
)

py_binary(
name = "run_op_characterization",
srcs = ["run_op_characterization.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
requirement("portpicker"),
"@com_google_absl_py//absl:app",
"@com_google_absl_py//absl/flags",
"@com_google_absl_py//absl/logging",
],
)

proto_library(
name = "design_stats_proto",
srcs = ["design_stats.proto"],
Expand Down Expand Up @@ -912,46 +899,3 @@ py_test(
"@com_google_absl_py//absl/testing:absltest",
],
)

py_binary(
name = "estimator_model_stats",
srcs = ["estimator_model_stats.py"],
python_version = "PY3",
srcs_version = "PY3",
deps = [
requirement("numpy"),
"//xls/estimators:estimator_model",
"//xls/estimators:estimator_model_py_pb2",
"@com_google_absl_py//absl:app",
"@com_google_absl_py//absl/flags",
"@com_google_absl_py//absl/logging",
"@com_google_protobuf//:protobuf_python",
],
)

py_test(
name = "estimator_model_stats_test",
srcs = ["estimator_model_stats_test.py"],
data = [
"testdata/asap7_delay_data_points.textproto",
"testdata/asap7_delay_model_stats.csv",
"testdata/sky130_delay_data_points.textproto",
"testdata/sky130_delay_model_stats.csv",
"testdata/unit_delay_data_points.textproto",
"testdata/unit_delay_model_stats.csv",
":estimator_model_stats",
],
python_version = "PY3",
srcs_version = "PY3",
tags = ["nomsan"], # scipy seems not to be msan-clean.
deps = [
"//xls/common:runfiles",
"//xls/common:test_base",
"@com_google_absl_py//absl/testing:absltest",
],
)

py_binary(
name = "make_release",
srcs = ["make_release.py"],
)

0 comments on commit e5e5eb1

Please sign in to comment.