Origen V93K SMT7 Library
 All Classes Namespaces Files Functions Variables Typedefs Macros
helpers.hpp
Go to the documentation of this file.
1 #ifndef ORIGEN_HELPERS_INCLUDED
2 #define ORIGEN_HELPERS_INCLUDED
3 
4 #include <stdlib.h>
5 #include <cerrno>
6 #include <string>
7 #include "../origen.hpp"
8 #include "mapi.hpp"
9 #include "rdi.hpp"
10 
11 using namespace std;
12 
13 namespace Origen {
14 
15 string extractPinsFromGroup(const string&);
16 bool pinExists(const string& pinName);
17 void synchronize(double = 1);
18 double calculateFrequency(const ARRAY_I&, double);
19 double calculatePeriod(const ARRAY_I&, double);
20 void overlaySubroutineOutput(string, string, uint64_t, int, int, int);
21 void overlaySubroutine(string, string, uint64_t, int);
22 void reverseOverlaySubroutine(string, string, uint64_t, int);
23 int numberOfOnes(uint32_t);
24 int numberOfZeros(uint32_t);
25 int64_t toInt(string, int = 0);
26 uint64_t toUInt(string, int = 0);
27 vector<string> split(const string&, char);
28 void split(const string&, char, vector<string>&);
29 string toHex(const uint64_t&);
30 string toStr(const uint64_t&);
31 void initializeSites();
32 void logParametricTest(string, int, double, LIMIT, string);
33 void logFunctionalTest(string, int, bool, string);
34 bool isPass(double, LIMIT);
35 string loStr(LIMIT);
36 string hiStr(LIMIT);
37 string upcase(string);
38 string downcase(string);
39 string lpad(string, int, char);
40 string rpad(string, int, char);
41 bool isEven(uint64_t);
42 bool isOdd(uint64_t);
43 LIMIT noLimits();
44 uint64_t flip(uint64_t, int);
45 string ltrim(string, const char* remove_chars = " \n\t\r\f\v");
46 string rtrim(string, const char* remove_chars = " \n\t\r\f\v");
47 string trim(string, const char* remove_chars = " \n\t\r\f\v");
48 double getUnitMultiplier(const string& units);
49 string getLabelFromBurst(const string& burst, const string& port);
50 string checksum16bits(const string&);
51 
52 namespace Time {
53 void initTime(bool = false);
54 int month();
55 int day();
56 int hour();
57 int minute();
58 int second();
59 }
60 }
61 
62 #endif
LIMIT noLimits()
Returns a LIMIT object with no limits enabled.
Definition: console.cpp:22
void logFunctionalTest(string name, int site, bool passed, string pattern)
Prints the result of a functional test to the console.
Definition: console.cpp:25
string downcase(string base)
Definition: misc.cpp:149
string checksum16bits(const string &mystring)
Definition: misc.cpp:425
double getUnitMultiplier(const string &units)
Definition: misc.cpp:366
string lpad(string base, int length, char fill)
Definition: misc.cpp:158
int second()
Get the Second.
Definition: time.cpp:58
string toStr(const uint64_t &val)
Definition: misc.cpp:132
bool isEven(uint64_t number)
Returns true if the given number is even.
Definition: misc.cpp:175
uint64_t flip(uint64_t input, int size)
Definition: misc.cpp:8
void initializeSites()
Definition: misc.cpp:344
int hour()
Get the Hour.
Definition: time.cpp:48
bool pinExists(const string &pinName)
Definition: misc.cpp:310
string trim(string str, const char *remove_chars)
Definition: misc.cpp:50
uint64_t toUInt(string str, int base)
See toInt, but returns an unsigned 64-bit integer.
Definition: misc.cpp:96
string upcase(string base)
Definition: misc.cpp:141
vector< string > split(const string &str, char delim)
Definition: misc.cpp:22
string toHex(const uint64_t &val)
Definition: misc.cpp:123
void logParametricTest(string name, int site, double result, LIMIT limits, string pin)
Prints the result of a parametric test to the console.
Definition: console.cpp:7
string extractPinsFromGroup(const string &groupname)
Supply a pin alias name and get the name of the physical pin returned.
Definition: misc.cpp:325
int day()
Get the Day.
Definition: time.cpp:43
int month()
Get the Month.
Definition: time.cpp:37
string getLabelFromBurst(const string &burst, const string &port)
Definition: misc.cpp:406
void reverseOverlaySubroutine(string subroutinePattern, string pin, uint64_t data, int size)
Same as overlaySubroutine but the data is applied in reverse order.
Definition: misc.cpp:238
bool isOdd(uint64_t number)
Returns true if the given number is odd.
Definition: misc.cpp:178
void synchronize(double timeout)
Definition: misc.cpp:292
string rpad(string base, int length, char fill)
Definition: misc.cpp:168
double calculateFrequency(const ARRAY_I &captureData, double periodInNs)
Definition: misc.cpp:272
void overlaySubroutineOutput(string subroutinePattern, string pin, uint64_t data, int size, int loOutputIndex, int hiOutputIndex)
Definition: misc.cpp:183
string ltrim(string str, const char *remove_chars)
Definition: misc.cpp:40
void initTime(bool reset)
Definition: time.cpp:23
int numberOfOnes(uint32_t i)
Returns the number of 1&#39;s (bits that are set) in the given 32-bit number.
Definition: misc.cpp:263
string rtrim(string str, const char *remove_chars)
Definition: misc.cpp:45
double calculatePeriod(const ARRAY_I &captureData, double periodInNs)
Definition: misc.cpp:286
string hiStr(LIMIT limits)
Definition: console.cpp:55
void overlaySubroutine(string subroutinePattern, string pin, uint64_t data, int size)
Definition: misc.cpp:214
int minute()
Get the Minute.
Definition: time.cpp:53
string loStr(LIMIT limits)
Definition: console.cpp:37
bool isPass(double val, LIMIT limits)
Returns true if the result is within the given limits.
Definition: console.cpp:71
int64_t toInt(string str, int base)
Definition: misc.cpp:66
int numberOfZeros(uint32_t i)
Returns the number of 0&#39;s (bits that are not set) in the given 32-bit number.
Definition: misc.cpp:270