TechModel.cc (10447:a465576671d4) TechModel.cc (10448:bc1a3b7ab5ef)
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
1#include "tech/TechModel.h"
2
3#include <cmath>
4
5#include "model/std_cells/StdCellLib.h"
6
7namespace DSENT
8{
9 TechModel::TechModel()
22#include "tech/TechModel.h"
23
24#include <cmath>
25
26#include "model/std_cells/StdCellLib.h"
27
28namespace DSENT
29{
30 TechModel::TechModel()
10 : Config(), m_std_cell_lib_(NULL), m_available_wire_layers_(NULL)
31 : m_std_cell_lib_(NULL), m_available_wire_layers_(NULL)
11 {}
12
13 TechModel::~TechModel()
14 {}
15
32 {}
33
34 TechModel::~TechModel()
35 {}
36
37 const String& TechModel::get(const String &key_) const
38 {
39 return params.at(key_);
40 }
41
16 void TechModel::setStdCellLib(const StdCellLib* std_cell_lib_)
17 {
18 m_std_cell_lib_ = std_cell_lib_;
19 return;
20 }
21
22 const StdCellLib* TechModel::getStdCellLib() const
23 {
24 return m_std_cell_lib_;
25 }
26
27 TechModel* TechModel::clone() const
28 {
29 return new TechModel(*this);
30 }
31
32 void TechModel::readFile(const String& filename_)
33 {
34 // Read the main technology file
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
35 LibUtil::Config::readFile(filename_);
61 LibUtil::readFile(filename_, params);
36
37 // Search for "INCLUDE" to include more technology files
62
63 // Search for "INCLUDE" to include more technology files
38 StringMap::ConstIterator it;
39 for(it = begin(); it != end(); ++it)
64 for (const auto &it : params)
40 {
65 {
41 const String& key = it->first;
66 const String& key = it.first;
42 if(key.compare(0, 8, "INCLUDE_") == 0)
43 {
67 if(key.compare(0, 8, "INCLUDE_") == 0)
68 {
44 const String& include_filename = it->second;
45 LibUtil::Config::readFile(include_filename);
69 const String& include_filename = it.second;
70 LibUtil::readFile(include_filename, params);
46 }
47 }
48
49 // Set the available wire layers
50 const vector<String>& available_wire_layer_vector = get("Wire->AvailableLayers").split("[,]");
51 m_available_wire_layers_ = new std::set<String>;
52 for(unsigned int i = 0; i < available_wire_layer_vector.size(); ++i)
53 {
54 m_available_wire_layers_->insert(available_wire_layer_vector[i]);
55 }
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 }
56 return;
57 }
58
59 //-------------------------------------------------------------------------
60 // Transistor Related Functions
61 //-------------------------------------------------------------------------
62 //Returns the leakage current of NMOS transistors, given the transistor stakcing, transistor widths, and input combination
63 double TechModel::calculateNmosLeakageCurrent(unsigned int num_stacks_, double uni_stacked_mos_width_, unsigned int input_vector_) const
64 {

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

309 //double unit_res = rho / ((width_ - 2.0 * barrier_thickness) * (metal_thickness - barrier_thickness));
310
311 double total_res = unit_res * length_;
312 return total_res;
313 }
314 //-------------------------------------------------------------------------
315
316 TechModel::TechModel(const TechModel& tech_model_)
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_)
317 : Config(tech_model_), m_std_cell_lib_(tech_model_.m_std_cell_lib_)
341 : m_std_cell_lib_(tech_model_.m_std_cell_lib_),
342 params(tech_model_.params)
318 {}
319} // namespace DSENT
343 {}
344} // namespace DSENT
320