1 /*
2  * CCvcParameters.hh
3  *
4  * Copyright 2014-2018 D. Mitch Bailey  cvc at shuharisystem dot com
5  *
6  * This file is part of cvc.
7  *
8  * cvc is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * cvc is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with cvc.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  * You can download cvc from https://github.com/d-m-bailey/cvc.git
22  */
23 
24 #ifndef CCVCPARAMETERS_HH_
25 #define CCVCPARAMETERS_HH_
26 
27 #include "Cvc.hh"
28 
29 #include "CModel.hh"
30 #include "CPower.hh"
31 #include "CCircuit.hh"
32 
33 #include <cstring>
34 
35 class CModeList {
36 
37 };
38 
39 class CCvcParameters {
40 public:
41 	const deviceId_t defaultErrorLimit = 100;
42 	const float	defaultLeakLimit = 200e-6;
43 	const int defaultSearchLimit = 100;
44 	const bool defaultSOI = false;
45 	const bool defaultSCRC = false;
46 	const bool defaultVthGates = false;
47 	const bool defaultMinVthGates = false;
48 	const bool defaultIgnoreVthFloating = false;
49 	const bool defaultIgnoreNoLeakFloating = false;
50 	const bool defaultLeakOvervoltage = true;
51 	const bool defaultLogicDiodes = false;
52 	const bool defaultAnalogGates = true;
53 	const bool defaultBackupResults = false;
54 	const voltage_t defaultErrorThreshold = 0;
55 	const size_t defaultParallelCircuitPortLimit = 0;
56 	const string defaultCellErrorLimitFile = "";
57 	const string defaultCellChecksumFile = "";
58 	const size_t defaultLargeCircuitSize = 10e6;
59 	const string defaultNetCheckFile = "";
60 	const string defaultModelCheckFile = "";
61 
62 	string	cvcReportTitle;
63 
64 	string	cvcParamterFilename = "";
65 	string	cvcTopBlock = "";
66 	string	cvcNetlistFilename = "";
67 	string	cvcMode = "";
68 	string	cvcModelFilename;
69 	string	cvcPowerFilename;
70 	string	cvcFuseFilename = "";
71 	string	cvcReportFilename;
72 	string	cvcReportDirectory;
73 	string	cvcReportName;
74 	string	cvcLockFile;
75 	string	cvcReportBaseFilename;
76 	CModelListMap	cvcModelListMap;
77 	CPowerPtrList	cvcPowerPtrList;
78 	CPowerPtrList	cvcExpectedLevelPtrList;
79 	CPowerPtrMap	cvcPowerMacroPtrMap;
80 	CInstancePowerPtrList	cvcInstancePowerPtrList;
81 	CPowerFamilyMap cvcPowerFamilyMap;
82 	unordered_map<string, int> cvcCellErrorLimit;
83 	deviceId_t	cvcCircuitErrorLimit = defaultErrorLimit;
84 	float	cvcLeakLimit = defaultLeakLimit;
85 	size_t		cvcSearchLimit = defaultSearchLimit;
86 	string	cvcHierarchyDelimiters = HIERARCHY_DELIMITER;
87 	bool	cvcSOI = defaultSOI;
88 	bool	cvcSCRC = defaultSCRC;
89 	bool	cvcVthGates = defaultVthGates;
90 	bool	cvcMinVthGates = defaultMinVthGates;
91 	bool	cvcIgnoreVthFloating = defaultIgnoreVthFloating;
92 	bool	cvcIgnoreNoLeakFloating = defaultIgnoreNoLeakFloating;
93 	bool	cvcLeakOvervoltage = defaultLeakOvervoltage;
94 	bool	cvcLogicDiodes = defaultLogicDiodes;
95 	bool	cvcAnalogGates = defaultAnalogGates;
96 	bool	cvcBackupResults = defaultBackupResults;
97 	voltage_t	cvcMosDiodeErrorThreshold = defaultErrorThreshold;
98 	voltage_t	cvcShortErrorThreshold = defaultErrorThreshold;
99 	voltage_t	cvcBiasErrorThreshold = defaultErrorThreshold;
100 	voltage_t	cvcForwardErrorThreshold = defaultErrorThreshold;
101 	voltage_t	cvcFloatingErrorThreshold = defaultErrorThreshold;
102 	voltage_t	cvcGateErrorThreshold = defaultErrorThreshold;
103 	voltage_t	cvcLeakErrorThreshold = defaultErrorThreshold;
104 	voltage_t	cvcExpectedErrorThreshold = defaultErrorThreshold;
105 	voltage_t	cvcOvervoltageErrorThreshold = defaultErrorThreshold;
106 	size_t	cvcParallelCircuitPortLimit = defaultParallelCircuitPortLimit;
107 	string	cvcCellErrorLimitFile = defaultCellErrorLimitFile;
108 	string	cvcCellChecksumFile = defaultCellChecksumFile;
109 	size_t	cvcLargeCircuitSize = defaultLargeCircuitSize;
110 	string  cvcNetCheckFile = defaultNetCheckFile;
111 	string  cvcModelCheckFile = defaultModelCheckFile;
112 
113 	string	cvcLastTopBlock;
114 	string	cvcLastNetlistFilename;
115 	bool	cvcLastSOI;
116 
117 	teestream& reportFile;
118 
CCvcParameters(teestream & theReportFile)119 	CCvcParameters(teestream& theReportFile) : reportFile(theReportFile) {};
120 
121 	string CvcFileName();
122 	bool	IsSameDatabase();
123 	void	SaveDatabaseParameters();
124 	void	ResetEnvironment();
125 	void	PrintEnvironment(ostream & theOutputFile = cout);
126 	void	PrintDefaultEnvironment();
127 	void	LoadEnvironment(const string theEnvironmentFilename, const string theReportPrefix);
128 	returnCode_t	LoadModels();
129 	returnCode_t	LoadPower();
130 	void	AddTestModels();
131 	void	AddTestPower();
132 	void	SetHiZPropagation();
133 	void	PrintPowerList(ostream & theLogFile, string theIndentation = "");
134 
135 };
136 
137 #endif /* CCVCPARAMETERS_HH_ */
138