|
24 | 24 | #include <string> |
25 | 25 | #include <string_view> |
26 | 26 | #include <tuple> |
27 | | -#include <utility> |
28 | 27 | #include <vector> |
29 | 28 |
|
30 | 29 | #include "gmock/gmock.h" |
|
46 | 45 | #include "xls/codegen/block_conversion_test_fixture.h" |
47 | 46 | #include "xls/codegen/codegen_options.h" |
48 | 47 | #include "xls/codegen/codegen_pass.h" |
49 | | -#include "xls/codegen/codegen_result.h" |
50 | 48 | #include "xls/codegen/ram_configuration.h" |
51 | 49 | #include "xls/codegen_v_1_5/convert_to_block.h" |
52 | 50 | #include "xls/common/casts.h" |
|
69 | 67 | #include "xls/ir/nodes.h" |
70 | 68 | #include "xls/ir/op.h" |
71 | 69 | #include "xls/ir/proc.h" |
72 | | -#include "xls/ir/proc_elaboration.h" |
73 | 70 | #include "xls/ir/register.h" |
74 | 71 | #include "xls/ir/source_location.h" |
75 | 72 | #include "xls/ir/value.h" |
76 | 73 | #include "xls/ir/verifier.h" |
77 | 74 | #include "xls/scheduling/pipeline_schedule.h" |
78 | 75 | #include "xls/scheduling/run_pipeline_schedule.h" |
79 | 76 | #include "xls/scheduling/scheduling_options.h" |
80 | | -#include "xls/scheduling/scheduling_result.h" |
81 | 77 | #include "xls/tools/codegen.h" |
82 | 78 | #include "xls/tools/codegen_flags.pb.h" |
83 | 79 | #include "xls/tools/scheduling_options_flags.pb.h" |
@@ -6799,27 +6795,25 @@ TEST_F(BlockConversionTest, TwoBitSelectorAllCasesPopulated) { |
6799 | 6795 | TEST_F(ProcConversionTestFixture, SimpleMultiProcConversion) { |
6800 | 6796 | XLS_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Package> p, |
6801 | 6797 | CreateMultiProcPackage()); |
6802 | | - SchedulingOptionsFlagsProto scheduling_options; |
6803 | | - scheduling_options.set_pipeline_stages(2); |
6804 | | - scheduling_options.set_delay_model("unit"); |
6805 | | - scheduling_options.set_multi_proc(true); |
| 6798 | + SchedulingOptions scheduling_options; |
| 6799 | + scheduling_options.pipeline_stages(2); |
| 6800 | + scheduling_options.delay_model("unit"); |
| 6801 | + scheduling_options.schedule_all_procs(true); |
6806 | 6802 |
|
6807 | | - CodegenFlagsProto codegen_options; |
6808 | | - codegen_options.set_flop_inputs(false); |
6809 | | - codegen_options.set_flop_outputs(false); |
6810 | | - codegen_options.set_reset("rst"); |
6811 | | - codegen_options.set_streaming_channel_data_suffix("_data"); |
6812 | | - codegen_options.set_streaming_channel_valid_suffix("_valid"); |
6813 | | - codegen_options.set_streaming_channel_ready_suffix("_ready"); |
6814 | | - codegen_options.set_module_name("p"); |
6815 | | - codegen_options.set_generator(GeneratorKind::GENERATOR_KIND_PIPELINE); |
| 6803 | + CodegenOptions codegen_options; |
| 6804 | + codegen_options.clock_name("clk"); |
| 6805 | + codegen_options.flop_inputs(false); |
| 6806 | + codegen_options.flop_outputs(false); |
| 6807 | + codegen_options.reset("rst", false, false, false); |
| 6808 | + codegen_options.streaming_channel_data_suffix("_data"); |
| 6809 | + codegen_options.streaming_channel_valid_suffix("_valid"); |
| 6810 | + codegen_options.streaming_channel_ready_suffix("_ready"); |
| 6811 | + codegen_options.module_name("p"); |
| 6812 | + codegen_options.generate_combinational(false); |
6816 | 6813 |
|
6817 | | - std::pair<SchedulingResult, verilog::CodegenResult> result; |
6818 | 6814 | XLS_ASSERT_OK_AND_ASSIGN( |
6819 | | - result, ScheduleAndCodegen(p.get(), scheduling_options, codegen_options, |
6820 | | - /*with_delay_model=*/true)); |
6821 | | - |
6822 | | - XLS_ASSERT_OK_AND_ASSIGN(Block * top_block, p->GetBlock("p")); |
| 6815 | + Block * top_block, |
| 6816 | + ConvertToBlock(p.get(), codegen_options, scheduling_options)); |
6823 | 6817 |
|
6824 | 6818 | std::vector<absl::flat_hash_map<std::string, uint64_t>> inputs; |
6825 | 6819 | std::vector<absl::flat_hash_map<std::string, uint64_t>> outputs; |
@@ -6897,27 +6891,25 @@ TEST_F(ProcConversionTestFixture, |
6897 | 6891 | SimpleMultiProcConversionWithFunctionsPresent) { |
6898 | 6892 | XLS_ASSERT_OK_AND_ASSIGN(std::unique_ptr<Package> p, |
6899 | 6893 | CreateMultiProcPackage(/*with_functions=*/true)); |
6900 | | - SchedulingOptionsFlagsProto scheduling_options; |
6901 | | - scheduling_options.set_pipeline_stages(2); |
6902 | | - scheduling_options.set_delay_model("unit"); |
6903 | | - scheduling_options.set_multi_proc(true); |
| 6894 | + SchedulingOptions scheduling_options; |
| 6895 | + scheduling_options.pipeline_stages(2); |
| 6896 | + scheduling_options.delay_model("unit"); |
| 6897 | + scheduling_options.schedule_all_procs(true); |
6904 | 6898 |
|
6905 | | - CodegenFlagsProto codegen_options; |
6906 | | - codegen_options.set_flop_inputs(false); |
6907 | | - codegen_options.set_flop_outputs(false); |
6908 | | - codegen_options.set_reset("rst"); |
6909 | | - codegen_options.set_streaming_channel_data_suffix("_data"); |
6910 | | - codegen_options.set_streaming_channel_valid_suffix("_valid"); |
6911 | | - codegen_options.set_streaming_channel_ready_suffix("_ready"); |
6912 | | - codegen_options.set_module_name("p"); |
6913 | | - codegen_options.set_generator(GeneratorKind::GENERATOR_KIND_PIPELINE); |
| 6899 | + CodegenOptions codegen_options; |
| 6900 | + codegen_options.clock_name("clk"); |
| 6901 | + codegen_options.flop_inputs(false); |
| 6902 | + codegen_options.flop_outputs(false); |
| 6903 | + codegen_options.reset("rst", false, false, false); |
| 6904 | + codegen_options.streaming_channel_data_suffix("_data"); |
| 6905 | + codegen_options.streaming_channel_valid_suffix("_valid"); |
| 6906 | + codegen_options.streaming_channel_ready_suffix("_ready"); |
| 6907 | + codegen_options.module_name("p"); |
| 6908 | + codegen_options.generate_combinational(false); |
6914 | 6909 |
|
6915 | | - std::pair<SchedulingResult, verilog::CodegenResult> result; |
6916 | 6910 | XLS_ASSERT_OK_AND_ASSIGN( |
6917 | | - result, ScheduleAndCodegen(p.get(), scheduling_options, codegen_options, |
6918 | | - /*with_delay_model=*/true)); |
6919 | | - |
6920 | | - XLS_ASSERT_OK_AND_ASSIGN(Block * top_block, p->GetBlock("p")); |
| 6911 | + Block * top_block, |
| 6912 | + ConvertToBlock(p.get(), codegen_options, scheduling_options)); |
6921 | 6913 |
|
6922 | 6914 | std::vector<absl::flat_hash_map<std::string, uint64_t>> inputs; |
6923 | 6915 | std::vector<absl::flat_hash_map<std::string, uint64_t>> outputs; |
@@ -6997,27 +6989,25 @@ TEST_F(ProcConversionTestFixture, SimpleFunctionWithProcsPresent) { |
6997 | 6989 | XLS_ASSERT_OK_AND_ASSIGN(Function * f0, p->GetFunction("f0")); |
6998 | 6990 | XLS_ASSERT_OK(p->SetTop(f0)); |
6999 | 6991 |
|
7000 | | - SchedulingOptionsFlagsProto scheduling_options; |
7001 | | - scheduling_options.set_pipeline_stages(1); |
7002 | | - scheduling_options.set_delay_model("unit"); |
7003 | | - scheduling_options.set_multi_proc(true); |
| 6992 | + SchedulingOptions scheduling_options; |
| 6993 | + scheduling_options.pipeline_stages(1); |
| 6994 | + scheduling_options.delay_model("unit"); |
| 6995 | + scheduling_options.schedule_all_procs(true); |
7004 | 6996 |
|
7005 | | - CodegenFlagsProto codegen_options; |
7006 | | - codegen_options.set_flop_inputs(false); |
7007 | | - codegen_options.set_flop_outputs(false); |
7008 | | - codegen_options.set_reset("rst"); |
7009 | | - codegen_options.set_streaming_channel_data_suffix("_data"); |
7010 | | - codegen_options.set_streaming_channel_valid_suffix("_valid"); |
7011 | | - codegen_options.set_streaming_channel_ready_suffix("_ready"); |
7012 | | - codegen_options.set_module_name("p"); |
7013 | | - codegen_options.set_generator(GeneratorKind::GENERATOR_KIND_PIPELINE); |
| 6997 | + CodegenOptions codegen_options; |
| 6998 | + codegen_options.clock_name("clk"); |
| 6999 | + codegen_options.flop_inputs(false); |
| 7000 | + codegen_options.flop_outputs(false); |
| 7001 | + codegen_options.reset("rst", false, false, false); |
| 7002 | + codegen_options.streaming_channel_data_suffix("_data"); |
| 7003 | + codegen_options.streaming_channel_valid_suffix("_valid"); |
| 7004 | + codegen_options.streaming_channel_ready_suffix("_ready"); |
| 7005 | + codegen_options.module_name("p"); |
| 7006 | + codegen_options.generate_combinational(false); |
7014 | 7007 |
|
7015 | | - std::pair<SchedulingResult, verilog::CodegenResult> result; |
7016 | 7008 | XLS_ASSERT_OK_AND_ASSIGN( |
7017 | | - result, ScheduleAndCodegen(p.get(), scheduling_options, codegen_options, |
7018 | | - /*with_delay_model=*/true)); |
7019 | | - |
7020 | | - XLS_ASSERT_OK_AND_ASSIGN(Block * top_block, p->GetBlock("p")); |
| 7009 | + Block * top_block, |
| 7010 | + ConvertToBlock(p.get(), codegen_options, scheduling_options)); |
7021 | 7011 |
|
7022 | 7012 | EXPECT_EQ(top_block->name(), "p"); |
7023 | 7013 | EXPECT_EQ(top_block->GetPorts().size(), 5); |
@@ -7073,9 +7063,6 @@ TEST_F(ProcConversionTestFixture, TrivialProcHierarchyWithProcScopedChannels) { |
7073 | 7063 | XLS_ASSERT_OK_AND_ASSIGN(Proc * top, pb.Build({})); |
7074 | 7064 | XLS_ASSERT_OK(p->SetTop(top)); |
7075 | 7065 |
|
7076 | | - XLS_ASSERT_OK_AND_ASSIGN(ProcElaboration elab, |
7077 | | - ProcElaboration::Elaborate(top)); |
7078 | | - |
7079 | 7066 | XLS_ASSERT_OK(ConvertToBlock( |
7080 | 7067 | p.get(), |
7081 | 7068 | CodegenOptions().reset("rst", false, false, false).clock_name("clk"), |
|
0 commit comments