Skip to content

Commit

Permalink
Added ability to usem5
Browse files Browse the repository at this point in the history
  • Loading branch information
wulffern committed Apr 13, 2024
1 parent 97ed99d commit 9ab65a9
Show file tree
Hide file tree
Showing 15 changed files with 436 additions and 332 deletions.
33 changes: 28 additions & 5 deletions cic-core/src/cells/capcell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ namespace cIcCells{

}

void CapCell::usem5(QJsonValue obj){
if(obj.toInt()){
usem5_ = true;
}else{
usem5_ = false;
}

}

void CapCell::heightIncreaseMult(QJsonValue obj){
heightIncreaseMult_ = obj.toInt();

Expand Down Expand Up @@ -97,7 +106,9 @@ namespace cIcCells{

//- First dummy
QList<Rect*> rects;
rects.append(new Rect("M5",x- msw ,y , mw, height));
if(usem5_){
rects.append(new Rect("M5",x- msw ,y , mw, height));
}
for (auto i =0; i<count;i +=1) {
auto r = new Rect("M4",x,y, mw, height);
rects.append(r);
Expand All @@ -110,22 +121,31 @@ namespace cIcCells{
if(usem3_){
rects.append(new Rect("M3",x + msw ,y + msw, mw, height - msw*2));
}
if(usem5_){
rects.append(new Rect("M5",x + msw ,y , mw, height));
}
x = x + (msw)*2;
}


auto xdm = x;
//- Add dumauto
auto ctdumauto = Cut::getInstance("M2","M5",1,2);
Instance * ctdumauto = nullptr;
if(usem5_){
ctdumauto = Cut::getInstance("M2","M5",1,2);
}else{
ctdumauto = Cut::getInstance("M2","M4",1,2);
}
ctdumauto->moveTo(x + msw,y + height/2 - ctdumauto->height());
this->add(ctdumauto);

for (auto i =0; i<count;i +=1) {
rects.append(new Rect("M2",x + msw ,y , mw, height));
rects.append(new Rect("M3",x + msw ,y , mw, height));
rects.append(new Rect("M4",x + msw ,y , mw, height));
rects.append(new Rect("M5",x + msw ,y, mw, height));
if(usem5_){
rects.append(new Rect("M5",x + msw ,y, mw, height));
}
xdm = xdm + (msw)*2;
}

Expand All @@ -141,8 +161,11 @@ namespace cIcCells{
auto y16 = y1a + msc*(b - 4);
yMax = height;

rects.append(new Rect("M5",xorg - msw, y ,x - xorg + msw*2, mw));
rects.append(new Rect("M5",xorg - msw, height - mw ,x - xorg + msw*2 , mw));
if(usem5_){
rects.append(new Rect("M5",xorg - msw, y ,x - xorg + msw*2, mw));
rects.append(new Rect("M5",xorg - msw, height - mw ,x - xorg + msw*2 , mw));
}


auto vss1 = new Rect("M2",xorg, y ,x - xorg +msw, mw);
auto ctop1 = new Rect("M4",xorg, y ,x - xorg, mw);
Expand Down
7 changes: 7 additions & 0 deletions cic-core/src/cells/capcell.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ namespace cIcCells{
*/
void usem3(QJsonValue obj);

Q_INVOKABLE
/**
* @brief Use Metal 5 shield
*/
void usem5(QJsonValue obj);

Q_INVOKABLE
/**
* @brief Increase multiplier height
Expand All @@ -54,6 +60,7 @@ namespace cIcCells{
int xorg = 0;
int yMax = 0;
bool usem3_ = true;
bool usem5_ = false;
int heightIncreaseMult_ = 1;


Expand Down
52 changes: 46 additions & 6 deletions cic-core/src/cells/sar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ using namespace cIcCore;
namespace cIcCells{


void SAR::usem5(QJsonValue obj){
if(obj.toInt()){
usem5_ = true;
}else{
usem5_ = false;
}

}

int SAR::getCellWidth(SARgroup groups, QString group)
{
int width = 0;
Expand Down Expand Up @@ -278,13 +287,28 @@ namespace cIcCells{
Rect* r = sarp_cmp[0];
if(r){

auto ct2 = Cut::getInstance("M4","M5",2,1);

auto ct_cmp =Cut::getInstance("M2","M4",2,1);
auto ct1 =Cut::getInstance("M4","M5",1,2);
Instance * ct2 = nullptr;
Instance * ct1 = nullptr;
if(usem5_){
ct2 = Cut::getInstance("M4","M5",2,1);
ct1 =Cut::getInstance("M4","M5",1,2);
}else{
ct2 = Cut::getInstance("M4","M3",2,1);
ct1 =Cut::getInstance("M4","M3",1,2);
}

int ycc = sarp->y2() +ct2->height()*4;
auto ra = new Rect("M4",r->x1(),ycc,mw,r->y1()-ycc);
ct_cmp->moveTo(r->x1(),r->y1());
auto rb_cmp = new Rect("M5",ra->x1(),sarp->y1(),mw,ycc-sarp->y1());

Rect * rb_cmp = nullptr;
if(usem5_){
rb_cmp = new Rect("M5",ra->x1(),sarp->y1(),mw,ycc-sarp->y1());
}else{
rb_cmp = new Rect("M3",ra->x1(),sarp->y1(),mw,ycc-sarp->y1());
}
ct2->moveTo(ra->x1(),sarp->y1());
ct1->moveTo(ra->x1(),ra->y1());
QList<Rect*> rects = QList<Rect*>() << ct_cmp << rb_cmp << ra << ct2 << ct1<< rb_cmp;
Expand All @@ -299,16 +323,32 @@ namespace cIcCells{

Rect* r = sarn_cmp[0];
if(r){
auto ct2 = Cut::getInstance("M4","M5",2,1);

auto ct_cmp =Cut::getInstance("M2","M3",2,1);
auto cta_cmp =Cut::getInstance("M3","M4",2,1);
auto ct1 =Cut::getInstance("M4","M5",1,2);

Instance * ct2 = nullptr;
Instance * ct1 = nullptr;
if(usem5_){
ct2 = Cut::getInstance("M4","M5",2,1);
ct1 =Cut::getInstance("M4","M5",1,2);
}else{
ct2 = Cut::getInstance("M4","M3",2,1);
ct1 =Cut::getInstance("M4","M3",1,2);
}


int ycc = sarp->y2() +ct2->height()*4;
auto ra = new Rect("M4",r->x2()+ms,ycc,mw,r->y1()-ycc);
cta_cmp->moveTo(r->x2() + ms + mw - ct_cmp->width(),r->y1());
ct_cmp->moveTo(r->x1(),r->y1());
auto rmet = new Rect("M3",ct_cmp->x1(),ct_cmp->y1(),cta_cmp->x2() - ct_cmp->x1(),ct_cmp->height());
auto rb_cmp = new Rect("M5",ra->x1(),sarn->y1(),mw,ycc-sarn->y1());
Rect * rb_cmp = nullptr;
if(usem5_){
rb_cmp = new Rect("M5",ra->x1(),sarn->y1(),mw,ycc-sarn->y1());
}else{
rb_cmp = new Rect("M3",ra->x1(),sarn->y1(),mw,ycc-sarn->y1());
}
ct2->moveTo(ra->x1(),sarn->y1());
ct1->moveTo(ra->x1(),ra->y1());
QList<Rect*> rects = QList<Rect*>() << cta_cmp << ct_cmp << rb_cmp << ra << ct2 << ct1<< rb_cmp;
Expand Down
7 changes: 7 additions & 0 deletions cic-core/src/cells/sar.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ namespace cIcCells{

virtual void place();
virtual void route();

Q_INVOKABLE
/**
* @brief Use Metal 5 shield
*/
void usem5(QJsonValue obj);

int getCellWidth(SARgroup groups,QString group);
cIcCore::Instance* placeAlternateMirror(SARgroup groups,QString group, int i, int x ,int y, int xoffset);
Expand All @@ -53,6 +59,7 @@ namespace cIcCells{

Rect* sarn = NULL;
Rect* sarp = NULL;
bool usem5_ = true;

};

Expand Down
2 changes: 2 additions & 0 deletions cic-core/src/core/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace cIcCore{
_physicalOnly = false;
abstract_ = false;
lib_cell_ = false;
lib_path_ = "";
cell_used_ = false;
_has_pr = false;

Expand Down Expand Up @@ -580,6 +581,7 @@ namespace cIcCore{

if(o.contains("ckt")){
cIcSpice::Subckt * subckt = new cIcSpice::Subckt();
subckt->setLibPath(lib_path_);
subckt->fromJson(o["ckt"].toObject());
_subckt = subckt;
}
Expand Down
1 change: 0 additions & 1 deletion cic-core/src/core/design.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ namespace cIcCore{
QString to = reg_arr[1].toString();
strlist.replaceInStrings(QRegularExpression(from),to);
}

}

_spice_parser.parseSubckt(0,strlist);
Expand Down
Loading

0 comments on commit 9ab65a9

Please sign in to comment.