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
74 changes: 74 additions & 0 deletions xls/dslx/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,58 @@ cc_library(
],
)

cc_library(
name = "conversion_record",
srcs = ["conversion_record.cc"],
hdrs = ["conversion_record.h"],
deps = [
":interp_value",
"//xls/common/status:status_macros",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:ast_node",
"//xls/dslx/frontend:module",
"//xls/dslx/frontend:proc_id",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type_info",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/log:check",
"@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_library(
name = "get_conversion_records",
srcs = ["get_conversion_records.cc"],
hdrs = ["get_conversion_records.h"],
deps = [
":conversion_record",
":interp_value",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:ast_node_visitor_with_default",
"//xls/dslx/frontend:ast_utils",
"//xls/dslx/frontend:builtin_stubs_utils",
"//xls/dslx/frontend:module",
"//xls/dslx/frontend:proc_id",
"//xls/dslx/ir_convert:ir_conversion_utils",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type_info",
"//xls/dslx/type_system_v2:import_utils",
"//xls/public:status_macros",
"@com_google_absl//absl/container:flat_hash_set",
"@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",
],
)

cc_test(
name = "error_test_utils_test",
srcs = ["error_test_utils_test.cc"],
Expand All @@ -953,6 +1005,28 @@ cc_test(
],
)

cc_test(
name = "get_conversion_records_test",
srcs = ["get_conversion_records_test.cc"],
deps = [
":conversion_record",
":create_import_data",
":get_conversion_records",
":import_data",
":interp_value",
":parse_and_typecheck",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/dslx/frontend:ast",
"//xls/dslx/type_system:parametric_env",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:status_matchers",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)

cc_binary(
name = "dslx_fmt",
srcs = ["dslx_fmt.cc"],
Expand Down
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.

#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/conversion_record.h"

#include <memory>
#include <optional>
Expand Down
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.

#include "xls/dslx/ir_convert/get_conversion_records.h"
#include "xls/dslx/get_conversion_records.h"

#include <cstdint>
#include <ios>
Expand All @@ -32,14 +32,14 @@
#include "absl/strings/str_format.h"
#include "xls/common/status/ret_check.h"
#include "xls/common/status/status_macros.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/ast_node_visitor_with_default.h"
#include "xls/dslx/frontend/ast_utils.h"
#include "xls/dslx/frontend/builtin_stubs_utils.h"
#include "xls/dslx/frontend/module.h"
#include "xls/dslx/frontend/proc_id.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/ir_convert/ir_conversion_utils.h"
#include "xls/dslx/type_system/parametric_env.h"
#include "xls/dslx/type_system/type_info.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef XLS_DSLX_IR_CONVERT_GET_CONVERSION_RECORDS_H_
#define XLS_DSLX_IR_CONVERT_GET_CONVERSION_RECORDS_H_
#ifndef XLS_DSLX_GET_CONVERSION_RECORDS_H_
#define XLS_DSLX_GET_CONVERSION_RECORDS_H_

#include <optional>
#include <variant>
#include <vector>

#include "absl/status/statusor.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/type_system/type_info.h"

namespace xls::dslx {
Expand All @@ -45,4 +45,4 @@ absl::StatusOr<std::vector<ConversionRecord>> GetConversionRecordsForEntry(

} // namespace xls::dslx

#endif // XLS_DSLX_IR_CONVERT_GET_CONVERSION_RECORDS_H_
#endif // XLS_DSLX_GET_CONVERSION_RECORDS_H_
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.

#include "xls/dslx/ir_convert/get_conversion_records.h"
#include "xls/dslx/get_conversion_records.h"

#include <optional>
#include <string>
Expand All @@ -26,11 +26,11 @@
#include "absl/status/status_matchers.h"
#include "absl/status/statusor.h"
#include "xls/common/status/matchers.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/create_import_data.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/import_data.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/parse_and_typecheck.h"
#include "xls/dslx/type_system/parametric_env.h"

Expand Down
84 changes: 5 additions & 79 deletions xls/dslx/ir_convert/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,6 @@ package(
licenses = ["notice"], # Apache 2.0
)

cc_library(
name = "conversion_record",
srcs = ["conversion_record.cc"],
hdrs = ["conversion_record.h"],
deps = [
"//xls/common/status:status_macros",
"//xls/dslx:interp_value",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:ast_node",
"//xls/dslx/frontend:module",
"//xls/dslx/frontend:proc_id",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type_info",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/log:check",
"@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_library(
name = "channel_scope",
srcs = ["channel_scope.cc"],
Expand Down Expand Up @@ -428,7 +405,6 @@ cc_library(
deps = [
":channel_scope",
":conversion_info",
":conversion_record",
":convert_format_macro",
":convert_options",
":fuzz_test_converter",
Expand All @@ -441,6 +417,7 @@ cc_library(
"//xls/common/status:status_macros",
"//xls/dslx:channel_direction",
"//xls/dslx:constexpr_evaluator",
"//xls/dslx:conversion_record",
"//xls/dslx:import_data",
"//xls/dslx:interp_value",
"//xls/dslx:interp_value_utils",
Expand Down Expand Up @@ -570,19 +547,19 @@ cc_library(
deps = [
":channel_scope",
":conversion_info",
":conversion_record",
":convert_options",
":extract_conversion_order",
":function_converter",
":get_conversion_records",
":ir_conversion_utils",
":proc_config_ir_converter",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/dslx:command_line_utils",
"//xls/dslx:constexpr_evaluator",
"//xls/dslx:conversion_record",
"//xls/dslx:create_import_data",
"//xls/dslx:error_printer",
"//xls/dslx:get_conversion_records",
"//xls/dslx:import_data",
"//xls/dslx:interp_value",
"//xls/dslx:parse_and_typecheck",
Expand Down Expand Up @@ -624,10 +601,10 @@ cc_library(
srcs = ["extract_conversion_order.cc"],
hdrs = ["extract_conversion_order.h"],
deps = [
":conversion_record",
"//xls/common:visitor",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/dslx:conversion_record",
"//xls/dslx:interp_value",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:ast_node",
Expand Down Expand Up @@ -657,10 +634,10 @@ cc_test(
name = "extract_conversion_order_test",
srcs = ["extract_conversion_order_test.cc"],
deps = [
":conversion_record",
":extract_conversion_order",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/dslx:conversion_record",
"//xls/dslx:create_import_data",
"//xls/dslx:interp_value",
"//xls/dslx:parse_and_typecheck",
Expand All @@ -672,57 +649,6 @@ cc_test(
],
)

cc_library(
name = "get_conversion_records",
srcs = ["get_conversion_records.cc"],
hdrs = ["get_conversion_records.h"],
deps = [
":conversion_record",
":ir_conversion_utils",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/dslx:interp_value",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:ast_node_visitor_with_default",
"//xls/dslx/frontend:ast_utils",
"//xls/dslx/frontend:builtin_stubs_utils",
"//xls/dslx/frontend:module",
"//xls/dslx/frontend:proc_id",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type_info",
"//xls/dslx/type_system_v2:import_utils",
"//xls/public:status_macros",
"@com_google_absl//absl/container:flat_hash_set",
"@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",
],
)

cc_test(
name = "get_conversion_records_test",
srcs = ["get_conversion_records_test.cc"],
deps = [
":conversion_record",
":get_conversion_records",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/dslx:create_import_data",
"//xls/dslx:import_data",
"//xls/dslx:interp_value",
"//xls/dslx:parse_and_typecheck",
"//xls/dslx/frontend:ast",
"//xls/dslx/type_system:parametric_env",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:status_matchers",
"@com_google_absl//absl/status:statusor",
"@googletest//:gtest",
],
)

cc_library(
name = "convert_format_macro",
srcs = ["convert_format_macro.cc"],
Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/extract_conversion_order.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "xls/common/status/ret_check.h"
#include "xls/common/status/status_macros.h"
#include "xls/common/visitor.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/ast_node.h"
#include "xls/dslx/frontend/ast_utils.h"
Expand All @@ -45,7 +46,6 @@
#include "xls/dslx/frontend/pos.h"
#include "xls/dslx/frontend/proc_id.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/type_system/parametric_env.h"
#include "xls/dslx/type_system/type_info.h"

Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/extract_conversion_order.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

#include "absl/log/check.h"
#include "absl/status/statusor.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/proc.h"
#include "xls/dslx/frontend/proc_id.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/type_system/parametric_env.h"
#include "xls/dslx/type_system/type_info.h"

Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/extract_conversion_order_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include "gtest/gtest.h"
#include "absl/container/flat_hash_map.h"
#include "xls/common/status/matchers.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/create_import_data.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/proc.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/parse_and_typecheck.h"
#include "xls/dslx/type_system/parametric_env.h"

Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/function_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "xls/common/visitor.h"
#include "xls/dslx/channel_direction.h"
#include "xls/dslx/constexpr_evaluator.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/ast_node.h"
#include "xls/dslx/frontend/ast_utils.h"
Expand All @@ -57,7 +58,6 @@
#include "xls/dslx/interp_value.h"
#include "xls/dslx/interp_value_utils.h"
#include "xls/dslx/ir_convert/channel_scope.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/ir_convert/convert_format_macro.h"
#include "xls/dslx/ir_convert/convert_options.h"
#include "xls/dslx/ir_convert/fuzz_test_converter.h"
Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/function_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
#include "absl/types/span.h"
#include "xls/common/attribute_data.h"
#include "xls/dslx/channel_direction.h"
#include "xls/dslx/conversion_record.h"
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/pos.h"
#include "xls/dslx/frontend/proc_id.h"
#include "xls/dslx/import_data.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/ir_convert/channel_scope.h"
#include "xls/dslx/ir_convert/conversion_info.h"
#include "xls/dslx/ir_convert/conversion_record.h"
#include "xls/dslx/ir_convert/convert_options.h"
#include "xls/dslx/ir_convert/proc_config_ir_converter.h"
#include "xls/dslx/mangle.h"
Expand Down
Loading
Loading