Skip to content

Commit

Permalink
Added warning for too few columns in patternTile pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
wulffern committed Feb 9, 2024
1 parent fc1deea commit c4f2536
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 16 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ endif

#- Should support most QT5 and QT6
DEFQMAKE=QMAKE_6
QMAKEOPT=
ifeq (${UNAME_S},Darwin)
#QMAKEOPT+= QMAKE_DEFAULT_LIBDIRS=${shell xcrun -show-sdk-path}/usr/lib
endif

QMAKE=qmake6
ifeq (, $(shell which ${QMAKE}))
QMAKE=qmake-qt5
Expand All @@ -86,7 +91,7 @@ compile:
echo "#define CICHASH \""${VERSION_HASH}"\"" >> cic/src/version.h
echo "#define CICVERSION \""${VERSION_DATE}"\"" > cic-gui/src/version.h
echo "#define CICHASH \""${VERSION_HASH}"\"" >> cic-gui/src/version.h
${QMAKE} -o qmake.make DEFINES+="${DEFQMAKE}" ciccreator.pro ${QTOPT}
${QMAKE} -o qmake.make DEFINES+="${DEFQMAKE}" ${QMAKEOPT} ciccreator.pro ${QTOPT}
${MAKE} -f qmake.make
test -d release || mkdir release
cp release/${CIC} release/cic.${OSBIN}${OSID}${OSVER}_${VERSION}
Expand All @@ -104,6 +109,7 @@ clean:
-rm cic-core/Makefile
-rm cic-gui/Makefile
-rm qmake.make
-rm -rf .qmake.stash
${foreach f, ${TESTS}, cd tests/${f} ; make clean;cd ../../;}

doxygen:
Expand Down
11 changes: 10 additions & 1 deletion cic-core/src/core/cut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ namespace cIcCore {

Instance * Cut::getInstance(QString layer1, QString layer2, int horizontal_cuts, int vertical_cuts){

//-No point in making a cut without layer transition
if(layer1 == layer2){
return nullptr;
}

InstanceCut *instance = 0;
QString tag1 = Cut::makeName(layer1,layer2,horizontal_cuts,vertical_cuts);
QString tag2 = Cut::makeName(layer2,layer1,horizontal_cuts,vertical_cuts);
Expand All @@ -292,7 +297,6 @@ namespace cIcCore {
c = cuts_[tag2];
}else{
c = new Cut(layer1,layer2,horizontal_cuts,vertical_cuts);

cuts_[c->name()] = c;
}

Expand All @@ -304,6 +308,11 @@ namespace cIcCore {

}

if(!instance){
std::string errorMessage = "Error: Could not create cut from " + layer1.toStdString() + " to " + layer2.toStdString();
throw std::runtime_error(errorMessage);
}

return instance;
}

Expand Down
5 changes: 5 additions & 0 deletions cic-core/src/core/design.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,16 @@ namespace cIcCore{
//Run through the array of design cells, and try an match objects
QJsonArray cellArray = cells.toArray();
foreach (const QJsonValue & value, cellArray) {
try{
QJsonObject c = value.toObject();
QJsonValue name = c["name"];
_cells[name.toString()] = c;

this->createCell(c);
}catch(const std::exception &exc){
console->error(exc.what());
throw exc;
}
}

}else{
Expand Down
4 changes: 3 additions & 1 deletion cic-core/src/core/layoutcell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,11 @@ namespace cIcCore{

QList<Rect*> rects = this->findAllRectangles(path,startlayer);

foreach(Rect* r, rects){
foreach(Rect* r, rects)
{
if(r == 0) continue;
Instance * inst= Cut::getInstance(startlayer,stoplayer,hcuts,vcuts);

inst->moveTo(r->x2() + xoffset*inst->width(),r->centerY() + yoffset*inst->height());

Rect * rstop = inst->getRect(stoplayer);
Expand Down
17 changes: 15 additions & 2 deletions cic-core/src/core/patterntile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,24 @@ namespace cIcCore {
currentHeight_ = yspace_*vmv;
currentHeightDelta_ = currentHeight_ - yspace_;
int ys = translateY(y);




for(int x=0;x <= xmax_;x++){


QString s = strs[strs.length() - y -1];




if((s.length()-1) < x){
qDebug() << "Error: To few columns in " << s;
}

QChar c = s[x];


if(c == '-'){continue;}

Rect * rect = new Rect();
Expand Down Expand Up @@ -587,7 +599,8 @@ namespace cIcCore {
this->paintRect(rect,c,x,y);

}



}
}

Expand Down
1 change: 0 additions & 1 deletion cic/cic.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ CONFIG += static
TEMPLATE = app
TARGET = cic


HEADERS += src/version.h \

include(../etc/mac_sdk.pro)
Expand Down
2 changes: 1 addition & 1 deletion cic/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int main(int argc, char *argv[])
throw "Die";
}

}catch(...){
}catch(const std::exception &exc){
qWarning() << "Usage: cic <JSON file> <Technology file> [<Output name>]";
qWarning() << "Example: cic examples/SAR_ESSCIRC16_28N.json examples/tech.json SAR_ESSCIRC16_28N";
qWarning() << "About: \n\tcIcCreator reads a JSON object definition file, technology rule file\n" <<
Expand Down
1 change: 0 additions & 1 deletion ciccreator.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
QMAKE_CFLAGS += $$(CFLAGS) -g
QMAKE_CXXFLAGS += $$(CCFLAGS) -g
CONFIG += c++11
#CONFIG += debug
CONFIG += static


Expand Down
12 changes: 4 additions & 8 deletions etc/mac_sdk.pro
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@

mac {
#- This needs to point to the SDK usually in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
# mac::QMAKE_MAC_SDK = macosx10.13
#mac::QMAKE_MAC_SDK = macosx10.14
#CONFIG += sdk
EXPORT_QMAKE_MAC_SDK = macosx14.2
#QT_MAC_SDK_NO_VERSION_CHECK = 1

#mac::QMAKE_MAC_SDK = macosx11.3
#mac::QMAKE_MAC_SDK = macosx12.1
#mac::QMAKE_MAC_SDK = macosx12.3
#mac::QMAKE_MAC_SDK = macosx13.3
# mac::QMAKE_MAC_SDK =
}
}
1 change: 1 addition & 0 deletions tests/sun_sar9b/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test:
cat SAR.cic | jq .cells > sar.json
cat ref.cic | jq .cells > ref.json
diff sar.json ref.json || exit 1;
cicpy svg SAR.cic sky130.tech SAR --x 300 --y 400 --scale 10

clean:
rm -f SAR.cic
Expand Down

0 comments on commit c4f2536

Please sign in to comment.