ieee754.part_mul_add.test package

Submodules

ieee754.part_mul_add.test.test_mul_pipe module

Unit tests for Buffered and Unbuffered pipelines

contains useful worked examples of how to use the Pipeline API, including:

  • Combinatorial Stage “Chaining”
  • class-based data stages
  • nmigen module-based data stages
  • special nmigen module-based data stage, where the stage is the module
  • Record-based data stages
  • static-class data stages
  • multi-stage pipelines (and how to connect them)
  • how to use the pipelines (see Test5) - how to get data in and out
class ieee754.part_mul_add.test.test_mul_pipe.ExampleAddRecordPlaceHolderStage

Bases: object

example use of a Record, with a placeholder as the processing result

ispec()

returns a Record using the specification

ospec()
process(i)

process the input data, returning a PlaceHolder class instance with attributes that exactly match those of the Record.

record_spec = [('src1', 16), ('src2', 16)]
class ieee754.part_mul_add.test.test_mul_pipe.PlaceHolder

Bases: object

class ieee754.part_mul_add.test.test_mul_pipe.Test5(dut, resultfn, data=None, stage_ctl=False)

Bases: object

rcv()
send()
class ieee754.part_mul_add.test.test_mul_pipe.TestInputMul(a, b)

Bases: object

the eq function, called by set_input, needs an incoming object that conforms to the Example2OpClass.eq function requirements easiest way to do that is to create a class that has the exact same member layout (self.op1, self.op2) as Example2OpClass

ieee754.part_mul_add.test.test_mul_pipe.data_2op()
ieee754.part_mul_add.test.test_mul_pipe.data_dict()
ieee754.part_mul_add.test.test_mul_pipe.data_placeholder()
ieee754.part_mul_add.test.test_mul_pipe.resultfn_3(data_o, expected, i, o)
ieee754.part_mul_add.test.test_mul_pipe.resultfn_5(data_o, expected, i, o)
ieee754.part_mul_add.test.test_mul_pipe.resultfn_8(data_o, expected, i, o)
ieee754.part_mul_add.test.test_mul_pipe.simd_calc_result(a, b)
ieee754.part_mul_add.test.test_mul_pipe.test0()
ieee754.part_mul_add.test.test_mul_pipe.test8()
ieee754.part_mul_add.test.test_mul_pipe.test_simd_mul()
ieee754.part_mul_add.test.test_mul_pipe.test_simd_mul1()

ieee754.part_mul_add.test.test_multiply module

class ieee754.part_mul_add.test.test_multiply.GenOrCheck

Bases: enum.Enum

An enumeration.

Check = 2
Generate = 1
class ieee754.part_mul_add.test.test_multiply.SIMDMulLane(a_signed, b_signed, bit_width, high_half)

Bases: object

class ieee754.part_mul_add.test.test_multiply.TestAddReduce(methodName='runTest')

Bases: unittest.case.TestCase

calculate_input_values(input_count: int, key: int, extra_keys: List[int] = []) -> (typing.List[int], typing.List[str])
subtest_file(input_count: int, register_levels: List[int]) → None
subtest_key(input_count: int, inputs: List[nmigen.hdl.ast.Signal], module: ieee754.part_mul_add.multiply.AddReduce, key: int, mask_list: List[int], gen_or_check: ieee754.part_mul_add.test.test_multiply.GenOrCheck) → Generator[Union[nmigen.sim.core.Delay, nmigen.sim.core.Tick, nmigen.sim.core.Passive, nmigen.hdl.ast.Assign, nmigen.hdl.ast.Value], Union[int, NoneType], NoneType]
subtest_register_levels(register_levels: List[int]) → None
subtest_run_sim(input_count: int, sim: nmigen.sim.core.Simulator, partition_4: nmigen.hdl.ast.Signal, partition_8: nmigen.hdl.ast.Signal, inputs: List[nmigen.hdl.ast.Signal], module: ieee754.part_mul_add.multiply.AddReduce, delay_cycles: int) → None
subtest_value(inputs: List[nmigen.hdl.ast.Signal], module: ieee754.part_mul_add.multiply.AddReduce, mask_list: List[int], gen_or_check: ieee754.part_mul_add.test.test_multiply.GenOrCheck, values: List[int]) → Generator[Union[nmigen.sim.core.Delay, nmigen.sim.core.Tick, nmigen.sim.core.Passive, nmigen.hdl.ast.Assign, nmigen.hdl.ast.Value], Union[int, NoneType], NoneType]
test_0() → None
test_0_1() → None
test_0_1_2() → None
test_0_1_2_3() → None
test_0_1_2_3_4() → None
test_0_1_2_3_4_5() → None
test_0_2() → None
test_0_3() → None
test_0_4() → None
test_0_5() → None
test_1() → None
test_2() → None
test_3() → None
test_4() → None
test_5() → None
test_empty() → None
class ieee754.part_mul_add.test.test_multiply.TestMul8_16_32_64(methodName='runTest')

Bases: unittest.case.TestCase

static get_tst_cases(lanes: List[ieee754.part_mul_add.test.test_multiply.SIMDMulLane], keys: Iterable[int]) → Iterable[Tuple[int, int]]
subtest_file(register_levels: List[int]) → None
subtest_lanes(lanes: List[ieee754.part_mul_add.test.test_multiply.SIMDMulLane], module: ieee754.part_mul_add.multiply.Mul8_16_32_64, gen_or_check: ieee754.part_mul_add.test.test_multiply.GenOrCheck) → Generator[Union[nmigen.sim.core.Delay, nmigen.sim.core.Tick, nmigen.sim.core.Passive, nmigen.hdl.ast.Assign, nmigen.hdl.ast.Value], Union[int, NoneType], NoneType]
subtest_lanes_2(lanes: List[ieee754.part_mul_add.test.test_multiply.SIMDMulLane], module: ieee754.part_mul_add.multiply.Mul8_16_32_64, gen_or_check: ieee754.part_mul_add.test.test_multiply.GenOrCheck) → Generator[Union[nmigen.sim.core.Delay, nmigen.sim.core.Tick, nmigen.sim.core.Passive, nmigen.hdl.ast.Assign, nmigen.hdl.ast.Value], Union[int, NoneType], NoneType]
subtest_register_levels(register_levels: List[int]) → None
subtest_value(a: int, b: int, module: ieee754.part_mul_add.multiply.Mul8_16_32_64, lanes: List[ieee754.part_mul_add.test.test_multiply.SIMDMulLane], gen_or_check: ieee754.part_mul_add.test.test_multiply.GenOrCheck) → Generator[Union[nmigen.sim.core.Delay, nmigen.sim.core.Tick, nmigen.sim.core.Passive, nmigen.hdl.ast.Assign, nmigen.hdl.ast.Value], Union[int, NoneType], NoneType]
test_0() → None
test_0_1() → None
test_0_10() → None
test_0_1_2() → None
test_0_1_2_3() → None
test_0_1_2_3_4() → None
test_0_1_2_3_4_5() → None
test_0_1_2_3_4_5_6() → None
test_0_1_2_3_4_5_6_7() → None
test_0_1_2_3_4_5_6_7_8() → None
test_0_1_2_3_4_5_6_7_8_9() → None
test_0_1_2_3_4_5_6_7_8_9_10() → None
test_0_2() → None
test_0_3() → None
test_0_4() → None
test_0_5() → None
test_0_6() → None
test_0_7() → None
test_0_8() → None
test_0_9() → None
test_1() → None
test_10() → None
test_2() → None
test_3() → None
test_4() → None
test_5() → None
test_6() → None
test_7() → None
test_8() → None
test_9() → None
test_empty() → None
test_signed_mul_from_unsigned()
test_simd_mul()
test_simd_mul_lane()
class ieee754.part_mul_add.test.test_multiply.TestPartitionPoints(methodName='runTest')

Bases: unittest.case.TestCase

test() → None
class ieee754.part_mul_add.test.test_multiply.TestPartitionedAdder(methodName='runTest')

Bases: unittest.case.TestCase

test() → None
ieee754.part_mul_add.test.test_multiply.create_ilang(dut, traces, test_name)
ieee754.part_mul_add.test.test_multiply.create_simulator(module: Any, traces: List[nmigen.hdl.ast.Signal], test_name: str) → nmigen.sim.core.Simulator
ieee754.part_mul_add.test.test_multiply.simd_mul(a, b, lanes)

Module contents