Skip to content
Draft
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
1 change: 1 addition & 0 deletions xls/build_rules/xls_providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ CODEGEN_FIELDS = {
"source_annotation_strategy": "The strategy to use for generating source annotations. Use 'comment'" +
"to generate comments, 'directive' to generate SystemVerilog `line directives, " +
"or 'none'",
"find_bounds_strategy": "Scheduler algorithm to use for finding minimum bounds.",
}

SCHEDULING_FIELDS = {
Expand Down
4 changes: 2 additions & 2 deletions xls/fdo/iterative_sdc_scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class IterativeSDCSchedulingModel : public SDCSchedulingModel {
public:
// Delay map is no longer needed as the delay calculation is completely
// handled by the delay manager.
IterativeSDCSchedulingModel(ScheduleGraph graph,
IterativeSDCSchedulingModel(const ScheduleGraph& graph,
const DelayManager& delay_manager)
: SDCSchedulingModel(std::move(graph), DelayMap(),
: SDCSchedulingModel(graph, DelayMap(),
/*initiation_interval=*/std::nullopt,
// Use kDefaultSdcSolutionTolerance as the tolerance
// as we unconditionally use glop with iterative
Expand Down
2 changes: 2 additions & 0 deletions xls/modules/zstd/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ COMMON_CODEGEN_ARGS = {
"clock_margin_percent": "20",
"multi_proc": "true",
"materialize_internal_fifos": "true",
"scheduling_strategy": "sdc",
"find_bounds_strategy": "asap",
}

xls_dslx_library(
Expand Down
143 changes: 142 additions & 1 deletion xls/scheduling/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,19 @@ cc_library(
srcs = ["min_cut_scheduler.cc"],
hdrs = ["min_cut_scheduler.h"],
deps = [
":asap_scheduler",
":function_partition",
":schedule_bounds",
":schedule_graph",
":schedule_util",
":scheduling_options",
"//xls/common/logging:log_lines",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand All @@ -159,7 +163,16 @@ cc_test(
srcs = ["min_cut_scheduler_test.cc"],
deps = [
":min_cut_scheduler",
":schedule_graph",
":scheduling_options",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir:bits",
"//xls/ir:function_builder",
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)
Expand All @@ -172,6 +185,7 @@ cc_library(
":schedule_bounds",
":schedule_graph",
":schedule_util",
":scheduler",
":scheduling_options",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
Expand Down Expand Up @@ -199,6 +213,27 @@ cc_library(
],
)

cc_test(
name = "sdc_scheduler_test",
srcs = ["sdc_scheduler_test.cc"],
deps = [
":schedule_graph",
":scheduling_options",
":sdc_scheduler",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir:bits",
"//xls/ir:channel",
"//xls/ir:channel_ops",
"//xls/ir:function_builder",
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)

cc_library(
name = "schedule_util",
srcs = ["schedule_util.cc"],
Expand Down Expand Up @@ -269,11 +304,14 @@ cc_library(
srcs = ["run_pipeline_schedule.cc"],
hdrs = ["run_pipeline_schedule.h"],
deps = [
":asap_scheduler",
":min_cut_scheduler",
":pipeline_schedule",
":random_scheduler",
":schedule_bounds",
":schedule_graph",
":schedule_util",
":scheduler",
":scheduling_options",
":sdc_scheduler",
"//xls/common:math_util",
Expand All @@ -298,7 +336,7 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/random:distributions",
"@com_google_absl//absl/random",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand All @@ -310,6 +348,7 @@ cc_library(
cc_test(
name = "pipeline_schedule_test",
srcs = ["pipeline_schedule_test.cc"],
shard_count = 5,
deps = [
":pipeline_schedule",
":pipeline_schedule_cc_proto",
Expand Down Expand Up @@ -756,6 +795,8 @@ cc_test(
":scheduling_pass",
"//xls/common:xls_gunit_main",
"//xls/common/file:get_runfile_path",
"//xls/common/logging:scoped_record_logs",
"//xls/common/logging:scoped_vlog_level",
"//xls/common/status:matchers",
"//xls/common/status:status_macros",
"//xls/fdo:synthesizer",
Expand All @@ -778,3 +819,103 @@ cc_test(
"@googletest//:gtest",
],
)

cc_library(
name = "scheduler",
hdrs = ["scheduler.h"],
deps = [
":schedule_bounds",
":scheduling_options",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
],
)

cc_library(
name = "asap_scheduler",
srcs = ["asap_scheduler.cc"],
hdrs = ["asap_scheduler.h"],
deps = [
":schedule_bounds",
":schedule_graph",
":scheduler",
":scheduling_options",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:span",
],
)

cc_test(
name = "asap_scheduler_test",
srcs = ["asap_scheduler_test.cc"],
deps = [
":asap_scheduler",
":schedule_graph",
":scheduling_options",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir:bits",
"//xls/ir:channel",
"//xls/ir:channel_ops",
"//xls/ir:function_builder",
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)

cc_library(
name = "random_scheduler",
srcs = ["random_scheduler.cc"],
hdrs = ["random_scheduler.h"],
deps = [
":asap_scheduler",
":schedule_bounds",
":schedule_graph",
":scheduler",
":scheduling_options",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/log",
"@com_google_absl//absl/random",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
],
)

cc_test(
name = "random_scheduler_test",
srcs = ["random_scheduler_test.cc"],
deps = [
":random_scheduler",
":schedule_graph",
":scheduling_options",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/estimators/delay_model:delay_estimator",
"//xls/ir:bits",
"//xls/ir:channel",
"//xls/ir:channel_ops",
"//xls/ir:function_builder",
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_absl//absl/random",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)
Loading
Loading