Deleted Added
sdiff udiff text old ( 10447:a465576671d4 ) new ( 10448:bc1a3b7ab5ef )
full compact
1/* Copyright (c) 2012 Massachusetts Institute of Technology
2 *
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
9 *
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 * THE SOFTWARE.
20 */
21
22#include "tech/TechModel.h"
23
24#include <cmath>
25
26#include "model/std_cells/StdCellLib.h"
27
28namespace DSENT
29{
30 TechModel::TechModel()
31 : m_std_cell_lib_(NULL), m_available_wire_layers_(NULL)
32 {}
33
34 TechModel::~TechModel()
35 {}
36
37 const String& TechModel::get(const String &key_) const
38 {
39 return params.at(key_);
40 }
41
42 void TechModel::setStdCellLib(const StdCellLib* std_cell_lib_)
43 {
44 m_std_cell_lib_ = std_cell_lib_;
45 return;
46 }
47
48 const StdCellLib* TechModel::getStdCellLib() const
49 {
50 return m_std_cell_lib_;
51 }
52
53 TechModel* TechModel::clone() const
54 {
55 return new TechModel(*this);
56 }
57
58 void TechModel::readFile(const String& filename_)
59 {
60 // Read the main technology file
61 LibUtil::readFile(filename_, params);
62
63 // Search for "INCLUDE" to include more technology files
64 for (const auto &it : params)
65 {
66 const String& key = it.first;
67 if(key.compare(0, 8, "INCLUDE_") == 0)
68 {
69 const String& include_filename = it.second;
70 LibUtil::readFile(include_filename, params);
71 }
72 }
73
74 // Set the available wire layers
75 const vector<String>& available_wire_layer_vector = get("Wire->AvailableLayers").split("[,]");
76 m_available_wire_layers_ = new std::set<String>;
77 for(unsigned int i = 0; i < available_wire_layer_vector.size(); ++i)
78 {
79 m_available_wire_layers_->insert(available_wire_layer_vector[i]);
80 }
81 }
82
83 //-------------------------------------------------------------------------
84 // Transistor Related Functions
85 //-------------------------------------------------------------------------
86 //Returns the leakage current of NMOS transistors, given the transistor stakcing, transistor widths, and input combination
87 double TechModel::calculateNmosLeakageCurrent(unsigned int num_stacks_, double uni_stacked_mos_width_, unsigned int input_vector_) const
88 {

--- 244 unchanged lines hidden (view full) ---

333 //double unit_res = rho / ((width_ - 2.0 * barrier_thickness) * (metal_thickness - barrier_thickness));
334
335 double total_res = unit_res * length_;
336 return total_res;
337 }
338 //-------------------------------------------------------------------------
339
340 TechModel::TechModel(const TechModel& tech_model_)
341 : m_std_cell_lib_(tech_model_.m_std_cell_lib_),
342 params(tech_model_.params)
343 {}
344} // namespace DSENT