Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ module assertions_top(
assign out = ult_XXX ? {add_XXX, y[0]} : y & {32{ult_XXX}};
`ifdef ASSERT_ON
`ifndef SYNTHESIS
__assertions__main_XXX_non_synth___assertions__main_y_ge_than_XXX: assert final ($isunknown(ult_XXX) || ult_XXX) else $fatal(0, "Assertion failure via fail! @ xls/examples/assertions/assertions.x:32:14-32:37");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:21:12-21:40");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:21:12-21:40");
__assertions__main_XXX_non_synth___assertions__main_y_ge_than_XXX: assert final ($isunknown(ult_XXX) || ult_XXX) else $fatal(0, "Assertion failure via fail! @ xls/examples/assertions/assertions.x:34:14-34:37");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:23:12-23:40");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:23:12-23:40");
`endif // SYNTHESIS
`endif // ASSERT_ON
endmodule
6 changes: 3 additions & 3 deletions xls/codegen/testdata/assertions_comb_no_ifdef_guards.svtxt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module assertions_top(
assign nand_XXX = ~(y > 32'h0000_XXX & ult_XXX & {add_XXX, y[0]} > 32'h0000_XXX);
assign nand_XXX = ~(ult_XXX & y > 32'h0000_XXX);
assign out = ult_XXX ? {add_XXX, y[0]} : y & {32{ult_XXX}};
__assertions__main_XXX_non_synth___assertions__main_y_ge_than_XXX: assert final ($isunknown(ult_XXX) || ult_XXX) else $fatal(0, "Assertion failure via fail! @ xls/examples/assertions/assertions.x:32:14-32:37");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:21:12-21:40");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:21:12-21:40");
__assertions__main_XXX_non_synth___assertions__main_y_ge_than_XXX: assert final ($isunknown(ult_XXX) || ult_XXX) else $fatal(0, "Assertion failure via fail! @ xls/examples/assertions/assertions.x:34:14-34:37");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:23:12-23:40");
__assertions__main_XXX_non_synth___assertions__main___assertions__main_XXX___itok__assertions__main___itok__assertions__main_XXX___itok__assertions__func_XXX__XXX_x_less_than_XXX: assert final ($isunknown(nand_XXX) || nand_XXX) else $fatal(0, "Assertion failure via assert! @ xls/examples/assertions/assertions.x:23:12-23:40");
endmodule
2 changes: 0 additions & 2 deletions xls/dslx/stdlib/round.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// Implements rounding for all rounding modes defined by the IEEE 754 standard.
//
// It handles unsigned, signed (two's complement), and sign-and-magnitude values.
Expand Down
43 changes: 11 additions & 32 deletions xls/dslx/stdlib/tests/round_tests.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

import std;
import round;

Expand Down Expand Up @@ -273,33 +271,26 @@ fn test_round_more_fractional_bits_sign_magnitude() {
#[test]
fn test_round_unsigned_minimal_cases() {
// num_bits_rounded = 0 is a no-op (early return path).
assert_eq(
(u1:0, u5:0b10101),
round::round_u(round::RoundingMode::RTP, u3:0, u5:0b10101));
assert_eq((u1:0, u5:0b10101), round::round_u(round::RoundingMode::RTP, u3:0, u5:0b10101));

let num_bits_rounded = u3:2;

// Real value is 2.5 (10 / 2^2). Tie between 2 and 3.
let unrounded = u5:0b01010;
assert_eq(
(u1:0, u5:0b01000),
round::round_u(round::RoundingMode::RNE, num_bits_rounded, unrounded));
(u1:0, u5:0b01000), round::round_u(round::RoundingMode::RNE, num_bits_rounded, unrounded));
assert_eq(
(u1:0, u5:0b01100),
round::round_u(round::RoundingMode::RNA, num_bits_rounded, unrounded));
(u1:0, u5:0b01100), round::round_u(round::RoundingMode::RNA, num_bits_rounded, unrounded));

// Real value is 2.75 (11 / 2^2). Non-tie; nearest is 3.
let unrounded = u5:0b01011;
assert_eq(
(u1:0, u5:0b01100),
round::round_u(round::RoundingMode::RNE, num_bits_rounded, unrounded));
(u1:0, u5:0b01100), round::round_u(round::RoundingMode::RNE, num_bits_rounded, unrounded));

// Real value is 7.75 (31 / 2^2). RTP would round to 8.0, which overflows u5 with 2
// fractional bits.
let unrounded = u5:0b11111;
assert_eq(
(u1:1, u5:0),
round::round_u(round::RoundingMode::RTP, num_bits_rounded, unrounded));
assert_eq((u1:1, u5:0), round::round_u(round::RoundingMode::RTP, num_bits_rounded, unrounded));
}

#[test]
Expand Down Expand Up @@ -328,29 +319,21 @@ fn test_round_signed_twos_complement_negative_cases() {
let unrounded = s5:-9;

// Nearest(-2.25) = -2
assert_eq(
(u1:0, s5:-8),
round::round_s(round::RoundingMode::RNE, num_bits_rounded, unrounded));
assert_eq((u1:0, s5:-8), round::round_s(round::RoundingMode::RNE, num_bits_rounded, unrounded));

// RTZ(-2.25) = -2
assert_eq(
(u1:0, s5:-8),
round::round_s(round::RoundingMode::RTZ, num_bits_rounded, unrounded));
assert_eq((u1:0, s5:-8), round::round_s(round::RoundingMode::RTZ, num_bits_rounded, unrounded));

// Floor(-2.25) = -3
assert_eq(
(u1:0, s5:-12),
round::round_s(round::RoundingMode::RTN, num_bits_rounded, unrounded));
assert_eq((u1:0, s5:-12), round::round_s(round::RoundingMode::RTN, num_bits_rounded, unrounded));
}

#[test]
fn test_round_signed_twos_complement_positive_overflow_sign_change() {
// 0.9375 = 15 / 2^4; rounding to 1.0 cannot be represented in s5 with 4 fractional bits.
let num_bits_rounded = u3:4;
let unrounded = s5:15;
assert_eq(
(u1:1, s5:0),
round::round_s(round::RoundingMode::RNE, num_bits_rounded, unrounded));
assert_eq((u1:1, s5:0), round::round_s(round::RoundingMode::RNE, num_bits_rounded, unrounded));
}

#[test]
Expand All @@ -360,10 +343,6 @@ fn test_round_signed_twos_complement_rounding_all_bits_negative_overflow() {
let num_bits_rounded = u3:5;
let unrounded = s5:-16; // -0.5 = -16 / 2^5

assert_eq(
(u1:1, s5:0),
round::round_s(round::RoundingMode::RTN, num_bits_rounded, unrounded));
assert_eq(
(u1:1, s5:0),
round::round_s(round::RoundingMode::RNA, num_bits_rounded, unrounded));
assert_eq((u1:1, s5:0), round::round_s(round::RoundingMode::RTN, num_bits_rounded, unrounded));
assert_eq((u1:1, s5:0), round::round_s(round::RoundingMode::RNA, num_bits_rounded, unrounded));
}
2 changes: 0 additions & 2 deletions xls/dslx/tests/const_if.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

fn multiply(a: u32, b: u32) -> u32 { a * b }

fn const_if_true(a: u32) -> u32 { const if true { a + u32:2 } else { multiply(a, u32:10) } }
Expand Down
2 changes: 0 additions & 2 deletions xls/dslx/tests/const_match.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

fn const_match_literal_bool(a: u32, b: u32) -> u32 {
const match false {
true => a,
Expand Down
2 changes: 0 additions & 2 deletions xls/dslx/tests/match_tuple_concat_inference.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2025 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 0 additions & 2 deletions xls/dslx/tests/parametric_impl.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2025 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion xls/examples/apfloat_add_parallel/apfloat_add_parallel.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// This floating point adder splits the computation into two parallel paths
// for lower latency. Code based on papers by P.M. Seidel and G. Even:
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/apfloat_fmac.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// DSLX implementation of a fused multiply-accumulate module, calculating
// `acc = a * b + acc`
// This is, effectively, an FMA unit that stores its result between ticks.
Expand Down
6 changes: 4 additions & 2 deletions xls/examples/assertions/assertions.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// Example of assertions being used in functions.
//
// NOTE: Generated Verilog assertions embed line numbers from this file. If
// lines in this file are added or deleted, update the golden files for the codegen
// diff tests using the `*_update_golden` build targets or via `dev_tools/rebuild_golden_files.sh`.

fn func_0<N: u32>(x: bits[N]) -> bits[N] {
const_assert!(N == u32:32);
Expand Down
1 change: 0 additions & 1 deletion xls/examples/bitonic_sort.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/capitalize.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2020 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/codegen_options/f_func.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2024 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/codegen_options/f_proc.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2024 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/const_if.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

proc Falsy {
req_r: chan<()> in;
Expand Down
1 change: 0 additions & 1 deletion xls/examples/const_match.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

fn const_match_literal_bool(a: u32, b: u32) -> u32 {
const match false {
Expand Down
1 change: 0 additions & 1 deletion xls/examples/constraint.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2022 The XLS Authors
//
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/crc32/crc32.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2020 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion xls/examples/cubic_bezier.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2020 The XLS Authors
//
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/custom_schedule.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2024 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion xls/examples/delay.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// This file implements a parametric delay proc implemented using external RAM.
//
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/delay_loopback_channel.x
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// This implements a parametric delay proc implemented using loopback channels that are ultimately
// generated as FIFOs.

#![feature(type_inference_v2)]

import std;

// TODO(google/xls#889): Make top parametric when supported.
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dot_product.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

// Parameterized fixed and floating point dot product
// implementations.
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_intro/crc32_one_byte.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2020 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_intro/crc32_one_byte_inferred.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2020 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_module/capitalize.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_module/some_caps.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_module/some_caps_streaming.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/dslx_module/some_caps_streaming_configured.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2024 The XLS Authors
//
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/ffi.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion xls/examples/find_index.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// find_index standard library function. This will be used as a synthesis
// flow example to determine how well the gate-level mapping is performed.

#![feature(type_inference_v2)]

import std;

Expand Down
1 change: 0 additions & 1 deletion xls/examples/fir_filter.x
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// processing, is essentially a convolution of a
// filter of a series of samples.

#![feature(type_inference_v2)]

import float32;

Expand Down
1 change: 0 additions & 1 deletion xls/examples/fp32_fmac.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

import float32;
import xls.examples.apfloat_fmac;
Expand Down
1 change: 0 additions & 1 deletion xls/examples/gcd.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/jpeg/idct_chen.x
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// reference for comparison to other JPEG decoding solutions (e.g. ensuring
// golden reference outputs are identical).

#![feature(type_inference_v2)]

const COEFF_PER_MCU = u32:64;
const COEFF_PER_MCU_U8 = u8:64;
Expand Down
1 change: 0 additions & 1 deletion xls/examples/large_array.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2022 The XLS Authors
//
Expand Down
2 changes: 0 additions & 2 deletions xls/examples/lfsr.x
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2021 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 0 additions & 1 deletion xls/examples/lfsr_proc.x
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

////////////////////////////////////////////////////////////////////////////////
// LFSR proc
Expand Down
1 change: 0 additions & 1 deletion xls/examples/matmul_4x4/matmul_4x4.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

// DSLX implementation of a 4x4 systolic array.

#![feature(type_inference_v2)]

import float32;

Expand Down
1 change: 0 additions & 1 deletion xls/examples/nested_sel.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2023 The XLS Authors
//
Expand Down
1 change: 0 additions & 1 deletion xls/examples/overflow_detect.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]

import std;

Expand Down
1 change: 0 additions & 1 deletion xls/examples/passthrough.x
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(type_inference_v2)]
#![feature(explicit_state_access)]
#![feature(generics)]

Expand Down
1 change: 0 additions & 1 deletion xls/examples/prefix_sum.x
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(type_inference_v2)]

// Copyright 2022 The XLS Authors
//
Expand Down
Loading
Loading