Adding subckt addComment method to describe interface
This commit is contained in:
parent
b36a0c5a62
commit
4120451990
|
@ -316,6 +316,8 @@ void Circuit::writeToFile(const string& filename) {
|
|||
spfile << " " << (*it).first << "=" << (*it).second;
|
||||
}
|
||||
spfile << endl;
|
||||
for (size_t j = 0 ; j < sub->getComments().size() ; j++)
|
||||
spfile << "* " << sub->getComments()[j] << endl;
|
||||
for (size_t j = 0 ; j < sub->getInstances().size() ; j++) {
|
||||
Instance* inst = sub->getInstances()[j];
|
||||
writeInstance(spfile, inst);
|
||||
|
|
|
@ -15,18 +15,21 @@ class Subckt {
|
|||
std::vector<std::string> _interfaces;
|
||||
std::vector<Instance*> _instances;
|
||||
std::map<std::string, std::string> _parameters;
|
||||
std::vector<std::string> _comments;
|
||||
|
||||
public:
|
||||
Subckt(std::string name): _name(name), _interfaces(), _instances(), _parameters() {}
|
||||
Subckt(std::string name): _name(name), _interfaces(), _instances(), _parameters(), _comments() {}
|
||||
~Subckt() {}
|
||||
|
||||
inline const std::string getName();
|
||||
inline const std::vector<std::string>& getInterfaces();
|
||||
inline const std::vector<Instance*>& getInstances();
|
||||
inline const std::map<std::string, std::string>& getParameters();
|
||||
inline const std::vector<std::string>& getComments();
|
||||
|
||||
inline void addInterface(std::string);
|
||||
inline void addInstance (Instance*);
|
||||
inline void addComment(std::string);
|
||||
|
||||
void addParameter(std::string, std::string);
|
||||
};
|
||||
|
@ -34,8 +37,10 @@ inline const std::string Subckt::getName() { retur
|
|||
inline const std::vector<std::string>& Subckt::getInterfaces() { return _interfaces; }
|
||||
inline const std::vector<Instance*>& Subckt::getInstances() { return _instances; }
|
||||
inline const std::map<std::string, std::string>& Subckt::getParameters() { return _parameters; }
|
||||
inline const std::vector<std::string>& Subckt::getComments() { return _comments; }
|
||||
|
||||
inline void Subckt::addInterface(std::string name) { _interfaces.push_back(name); }
|
||||
inline void Subckt::addInstance(Instance* inst) { _instances.push_back(inst); }
|
||||
inline void Subckt::addInstance (Instance* inst) { _instances.push_back(inst); }
|
||||
inline void Subckt::addComment (std::string com) { _comments.push_back(com); }
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue