-
Notifications
You must be signed in to change notification settings - Fork 0
/
subvec.h
62 lines (52 loc) · 1.31 KB
/
subvec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Subvec
*
* Copyright (c) 2015-2021 Gemini Complex Corporation. All rights reserved.
*
*/
#ifndef SUBVEC_H
#define SUBVEC_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
/*
* A 4 bit subvec holds the stimulus and expect for one pin.
*
*/
enum subvecs {
DUT_SUBVEC_NONE = 0xf,
DUT_SUBVEC_0 = 0x0,
DUT_SUBVEC_1 = 0x1,
DUT_SUBVEC_X = 0x2,
DUT_SUBVEC_H = 0x3,
DUT_SUBVEC_L = 0x4,
DUT_SUBVEC_C = 0x5
} __attribute__ ((__packed__));
/*
* Each vector is 128 bytes but only 100 are used for the actual vector.
* the rest of the 28 bytes are used for the opcode and it's operand.
*
*/
enum subvec_opcode {
DUT_OPCODE_NOP = 0xff,
DUT_OPCODE_VEC = 0x01,
DUT_OPCODE_VECLOOP = 0x02,
DUT_OPCODE_VECCLK = 0x03
} __attribute__ ((__packed__));
enum subvecs get_subvec_by_pin_id(uint8_t *packed_subvecs,
uint32_t pin_id);
void pack_subvecs_by_pin_id(uint8_t *packed_subvecs,
uint32_t pin_id, enum subvecs subvec);
void pack_subvecs_by_dut_io_id(uint8_t *packed_subvecs,
uint32_t dut_io_id, enum subvecs subvec);
void pack_subvecs_with_opcode_and_operand(uint8_t *packed_subvecs,
enum subvec_opcode opcode, uint64_t operand);
#ifdef __cplusplus
}
#endif
#endif