Example #1
0
def test_state_machine():
    run_test_state_machine(LookupTable,
                           LookupTableFL,
                           (LookupTableInterface(Bits(4), Bits(4)), {
                               0b1111: 0b1010,
                               0b0101: 0b0000
                           }),
                           translate_model=True)
Example #2
0
def test_state_machine():
  run_test_state_machine(
      ImmDecoder,
      ImmDecoderFL, (ImmDecoderInterface(DECODED_IMM_LEN)),
      translate_model=False,
      argument_strategy={
          'decode':
              ArgumentStrategy(
                  type_=ArgumentStrategy.value_strategy(ImmType.size - 1))
      })
Example #3
0
def test_state_machine(translate):

  def get_updated_compare(dut_result, ref_result):
    valid_tags_dut = [
        tag for valid, tag in zip(dut_result["valid"], dut_result["tags"])
        if valid
    ]
    valid_tags_ref = [
        tag for valid, tag in zip(ref_result["valid"], ref_result["tags"])
        if valid
    ]

    return len(valid_tags_dut) == len(valid_tags_ref) and all(
        tag_dut == tag_ref for tag_dut, tag_ref in zip(
            sorted(set(valid_tags_dut)), sorted(set(valid_tags_ref))))

  run_test_state_machine(
      DataFlowManager,
      DataFlowManagerFL,
      (DataFlowManagerInterface(64, 32, 64, 4, 2, 2, 1, 4, 4)),
      translate_model=(translate == 'verilate'),
      customized_comparators={"get_updated": get_updated_compare})
Example #4
0
def test_state_machine_and():
  run_test_state_machine(
      And, AndFL, (LogicOperatorInterface(10)), translate_model=True)
Example #5
0
def test_state_machine():
    run_test_state_machine(RegisterFile, RegisterFileFL,
                           (8, 4, 1, 1, False, False))
Example #6
0
def test_state_machine():
    run_test_state_machine(LookupRegisterFile,
                           LookupRegisterFileFL, (LookupRegisterFileInterface(
                               Bits(8), Bits(8), 2, 2), [(2, 4), 3], [0, 0]),
                           translate_model=True)
Example #7
0
def test_state_machine():
    run_test_state_machine(ThermometerMask,
                           ThermometerMaskFL, (ThermometerMaskInterface(4)),
                           translate_model=True)
Example #8
0
def test_state_machine_priority():
    run_test_state_machine(PriorityArbiter,
                           PriorityArbiterFL, (ArbiterInterface(4)),
                           translate_model=False)
Example #9
0
def test_state_machine():
    run_test_state_machine(RenameTable, RenameTableFL,
                           (2, 4, 2, 1, 2, True, [0, 0]))
Example #10
0
def test_state_machine():
    run_test_state_machine(FreeList, FreeListFL, (4, 2, 1, True, False))
Example #11
0
def test_state_machine2():
    run_test_state_machine(MulRetimedPipelined, MulCL,
                           (MulPipelinedInterface(64), 4))
Example #12
0
def test_state_machine_single_cycle():
    run_test_state_machine(MulPipelined, MulCL, (MulPipelinedInterface(64), 1))
Example #13
0
def test_state_machine():
    run_test_state_machine(Sext, SextFL, SextInterface(2, 4))
def test_state_machine():
    run_test_state_machine(SnapshottingRegisterFile,
                           SnapshottingRegisterFileFL,
                           (8, 4, 1, 1, False, False, 4))
Example #15
0
def test_state_machine_or():
  run_test_state_machine(
      Or, OrFL, (LogicOperatorInterface(10)), translate_model=True)
Example #16
0
def test_state_machine_equals():
  run_test_state_machine(
      Equals, EqualsFL, (BinaryComparatorInterface(4)), translate_model=True)
Example #17
0
def test_state_machine(size):
    run_test_state_machine(RandomReplacementCAM,
                           RandomReplacementCAMFL,
                           (CAMInterface(Bits(4), Bits(8)), size),
                           translate_model=True)
Example #18
0
def test_state_machine_round_robin():
    run_test_state_machine(RoundRobinArbiter,
                           RoundRobinArbiterFL, (ArbiterInterface(4)),
                           translate_model=False)
Example #19
0
def test_state_machine():
    run_test_state_machine(
        CaseMux,
        CaseMuxFL, (CaseMuxInterface(Bits(4), Bits(4), 2), [0b1111, 0b0101]),
        translate_model=True)
Example #20
0
def test_state_machine():
  run_test_state_machine(
      OverlapChecker,
      OverlapCheckerFL,
      OverlapCheckerInterface(64, 8),
      translate_model=True)
Example #21
0
def test_state_machine():
    run_test_state_machine(SnapshottingFreeList, SnapshottingFreeListFL,
                           (4, 1, 1, 4))