Skip to content

Commit fd08d76

Browse files
grebecopybara-github
authored andcommitted
Clean up codegen options.
PiperOrigin-RevId: 612961319
1 parent 14fbb92 commit fd08d76

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

xls/codegen/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ cc_library(
435435
"//xls/ir:op",
436436
"//xls/ir:register",
437437
"@com_google_absl//absl/container:flat_hash_map",
438+
"@com_google_absl//absl/types:span",
438439
],
439440
)
440441

xls/codegen/codegen_options.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
#ifndef XLS_CODEGEN_CODEGEN_OPTIONS_H_
1616
#define XLS_CODEGEN_CODEGEN_OPTIONS_H_
1717

18+
#include <cstdint>
1819
#include <memory>
1920
#include <optional>
2021
#include <string>
2122
#include <string_view>
2223
#include <vector>
2324

2425
#include "absl/container/flat_hash_map.h"
26+
#include "absl/types/span.h"
2527
#include "xls/codegen/module_signature.pb.h"
2628
#include "xls/codegen/op_override.h"
2729
#include "xls/codegen/ram_configuration.h"
@@ -42,7 +44,7 @@ class CodegenOptions {
4244
~CodegenOptions() = default;
4345

4446
// Enum to describe how IO should be registered.
45-
enum class IOKind { kFlop = 0, kSkidBuffer, kZeroLatencyBuffer };
47+
enum class IOKind : uint8_t { kFlop = 0, kSkidBuffer, kZeroLatencyBuffer };
4648

4749
// Convert IOKind enum to a string.
4850
static std::string_view IOKindToString(IOKind kind);
@@ -71,7 +73,7 @@ class CodegenOptions {
7173
// Name to use for the generated module. If not given, the name of the XLS
7274
// function/proc is used.
7375
CodegenOptions& module_name(std::string_view name);
74-
const std::optional<std::string_view> module_name() const {
76+
std::optional<std::string_view> module_name() const {
7577
return module_name_;
7678
}
7779

@@ -113,12 +115,12 @@ class CodegenOptions {
113115
bool separate_lines() const { return separate_lines_; }
114116

115117
// Whether to flop inputs into a register at the beginning of the pipeline. If
116-
// true, adds a single cycle to the latency of the pipline.
118+
// true, adds a single cycle to the latency of the pipeline.
117119
CodegenOptions& flop_inputs(bool value);
118120
bool flop_inputs() const { return flop_inputs_; }
119121

120122
// Whether to flop outputs into a register at the end of the pipeline. If
121-
// true, adds a single cycle to the latency of the pipline.
123+
// true, adds a single cycle to the latency of the pipeline.
122124
CodegenOptions& flop_outputs(bool value);
123125
bool flop_outputs() const { return flop_outputs_; }
124126

0 commit comments

Comments
 (0)