From 4120451990e38fd2814a92af2c21253f24710c48 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Mon, 16 May 2011 12:36:11 +0000 Subject: [PATCH] Adding subckt addComment method to describe interface --- vlsisapd/src/spice/src/Circuit.cpp | 2 ++ vlsisapd/src/spice/src/vlsisapd/spice/Subckt.h | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vlsisapd/src/spice/src/Circuit.cpp b/vlsisapd/src/spice/src/Circuit.cpp index 01138a1c..fda2f428 100644 --- a/vlsisapd/src/spice/src/Circuit.cpp +++ b/vlsisapd/src/spice/src/Circuit.cpp @@ -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); diff --git a/vlsisapd/src/spice/src/vlsisapd/spice/Subckt.h b/vlsisapd/src/spice/src/vlsisapd/spice/Subckt.h index 5428b5e8..12a6c955 100644 --- a/vlsisapd/src/spice/src/vlsisapd/spice/Subckt.h +++ b/vlsisapd/src/spice/src/vlsisapd/spice/Subckt.h @@ -15,18 +15,21 @@ class Subckt { std::vector _interfaces; std::vector _instances; std::map _parameters; + std::vector _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& getInterfaces(); inline const std::vector& getInstances(); inline const std::map& getParameters(); + inline const std::vector& 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& Subckt::getInterfaces() { return _interfaces; } inline const std::vector& Subckt::getInstances() { return _instances; } inline const std::map& Subckt::getParameters() { return _parameters; } +inline const std::vector& 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