Skip to content

Commit 5d2d29a

Browse files
authored
Merge pull request #39 from wulffern/develop
Develop
2 parents 32a2145 + cb27266 commit 5d2d29a

37 files changed

+1200
-466
lines changed

.buildstatus_develop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Date: Sun May 21 08:55:17 CEST 2017
2+
Error: 1
3+
Message:
4+
Compile OK
5+
LVS ALGIC001_SAR9B_CV FAIL
6+
LVS ALGIC002_SAR9B_EV OK
7+
LVS ALGIC004_SAR9BXL_CV FAIL
8+
LVS ALGIC005_SAR9BXLC_CV FAIL
9+

Makefile

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@ CMD=time ../bin/cic
2525
ifeq ($(OS),Windows_NT)
2626
#- Not compatible with windows yet
2727
OSNAME=Windows
28+
OSBIN=windows
2829
GDS3D=WINDOWS
2930
else
3031
UNAME_S := $(shell uname -s)
3132
ifeq ($(UNAME_S),Darwin)
3233
OSNAME=macOS
34+
OSBIN=darwin
3335
GDS3D=GDS3D/mac/GDS3D.app/Contents/MacOS/GDS3D
3436
endif
3537
ifeq ($(UNAME_S),Linux)
3638
OSNAME=Linux
39+
OSBIN=linux
3740
GDS3D=GDS3D/linux/GDS3D
3841
endif
3942
endif
@@ -48,6 +51,9 @@ lay:
4851
qmake:
4952
qmake -o qmake.make ciccreator.pro
5053

54+
windeploy:
55+
windeployqt bin/windows/cic-gui.exe
56+
5157
xcode:
5258
qmake -o qmake.make ciccreator.pro -spec macx-xcode
5359

@@ -84,17 +90,27 @@ minecraft: lay
8490
routes: lay
8591
cd lay; ${CMD} ${EXAMPLE}/routes.json ${TECHFILE} routes ${OPT}
8692

93+
esscircbulk:
94+
cd examples; cp ${LIBNAME}.json SAR_ESSCIRC16_28NBULK.json
95+
cd examples; cp ${LIBNAME}.hier SAR_ESSCIRC16_28NBULK.hier
96+
${MAKE} esscirc LIBNAME=SAR_ESSCIRC16_28NBULK
97+
8798
esscirc: lay
88-
cd lay; ${CMD} ${EXAMPLE}/${LIBNAME}.json ${TECHFILE} ${LIBNAME} ${OPT}
89-
./scripts/cics2spice lay/SAR_ESSCIRC16_28N.cics lay/SAR_ESSCIRC16_28N.spice
90-
cd lay ; ../bin/cic2eps ${EXAMPLE}/${LIBNAME}.json ${EXAMPLE}/tech_eps.json ${CELL}
91-
cd lay ; ../bin/cic2png ${EXAMPLE}/${LIBNAME}.json ${TECHFILE} ${EXAMPLE}/${LIBNAME}.hier
9299

93-
view: lay
94-
cd lay; ../bin/cic-gui ${TECHFILE} ${LIBNAME}.cicl &
100+
cd lay; ../bin/${OSBIN}/cic ${EXAMPLE}/${LIBNAME}.json ${TECHFILE} ${LIBNAME} ${OPT}
101+
-./scripts/cics2aimspice lay/${LIBNAME}.cics lay/${LIBNAME}.spice
102+
cd lay ; ../bin/${OSBIN}/cic2eps ${EXAMPLE}/${LIBNAME}.json ${EXAMPLE}/tech_eps.json ${CELL}
103+
cd lay ; ../bin/${OSBIN}/cic2png ${EXAMPLE}/${LIBNAME}.json ${TECHFILE} ${EXAMPLE}/${LIBNAME}.hier
104+
95105

106+
view: lay
107+
ifeq ($(UNAME_S),Darwin)
108+
cd lay; ../bin/darwin/cic-gui.app/Contents/MacOS/cic-gui ${TECHFILE} ${LIBNAME}.cicl &
109+
else
110+
cd lay; ../bin/${OSBIN}/cic-gui ${TECHFILE} ${LIBNAME}.cicl &
111+
endif
96112
view-routes: lay
97-
cd lay; ../bin/cic-gui ${TECHFILE} routes.json &
113+
cd lay; ../bin/${OSBIN}/cic-gui ${TECHFILE} routes.json &
98114

99115
GDS3D:
100116
wget https://sourceforge.net/projects/gds3d/files/GDS3D%201.8/GDS3D_1.8.tar.bz2/download

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ciccreator
2-
Back in 2013 I started playing with the thought of generating a SAR ADC with a script, such that it would be easy to port between technologies. The prototype was written in Perl, and contained 16k lines of code. The Perl compiler is closed source, and not available outside NTNU. cIcCreator is the C++ version, it's been written from scratch to support the same input files as the Perl compiler, but with a vastly improved performance.
2+
Back in 2013 I started playing with the thought of generating a SAR ADC with a script, such that it would be easy to port between technologies. The prototype was written in Perl, and contained 16k lines of code. The Perl compiler is closed source, and not available outside NTNU. cIcCreator is the C++ version, it's been written from scratch to support the same input files as the Perl compiler, but with a vastly improved performance.
33

44
# Master plan, part 1
55
:white_check_mark: Create prototype of compiler in Perl that can compile SAR ADCs (Aug 2014)
@@ -10,7 +10,7 @@ Back in 2013 I started playing with the thought of generating a SAR ADC with a s
1010

1111
:white_check_mark: Rewrite the compiler in C++ under a GPL license and compile equivalent GDS with Perl compiler (Nov 2016)
1212

13-
:x: Encourage development of open source, free IP blocks for academic use
13+
:white_check_mark: Encourage development of open source, free IP blocks for academic use ([Open Source Custom IC Creator packages](https://github.com/wulffern/oscic))
1414

1515
The vision is that "Custom IC Creator" will be a rapid layout generation tool for SAR ADCs.
1616

@@ -20,22 +20,55 @@ The vision is that "Custom IC Creator" will be a rapid layout generation tool fo
2020
# Compile
2121
Install > Qt5.4 (i.e http://download.qt.io/archive/qt/5.4/5.4.2/qt-opensource-linux-x64-5.4.2.run), and edit bashrc.config to point to your Qt5.4 path, then
2222

23+
On Linux or Mac:
24+
2325
source bashrc.config
2426
make
2527

28+
On Windows, make sure you install MinGW > 4.9.2 with the Qt installation. Open console (Start - Qt - 5.x - MinGW - Qt5.x for Desktop).
29+
30+
mingw32-make
31+
32+
2633
# Test
34+
On Linux or Mac:
2735

2836
make esscirc
2937

38+
On Windows:
39+
40+
mingw32-make esscirc
41+
3042
# Viewing
3143
Open GDSII file or open built in viewer
3244

45+
On Linux or Mac:
46+
3347
make view
3448

35-
Or you can use GDS3D from https://sourceforge.net/projects/gds3d/
49+
On Windows:
50+
51+
mingw32-make view
52+
53+
Or on Linux or Mac you can use GDS3D from https://sourceforge.net/projects/gds3d/
3654

3755
make view3d
3856

57+
58+
# Simulation
59+
The spice file that comes out of ciccreator is compatible with
60+
AimSpice (http://www.aimspice.com).
61+
62+
63+
On Mac:
64+
- Install AimSpice
65+
- Run:
66+
67+
make esscircbulk
68+
- Open aimspice
69+
- Open sim/tb_sarbssw.cir
70+
- Press run
71+
3972
# cIcCreator in action
4073

4174
Minecraft video - https://youtu.be/J9lhEt0f3Wk

bin/start_script.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,16 @@ if [ $platform == "darwin" ]; then
4747
else
4848
$dirname/${platform}/${appname} "$@"
4949
fi
50-
fi
5150

51+
else
52+
53+
export PATH=$dirname/windows/:$PATH
54+
echo $PATH
55+
execfile=$dirname/windows/${appname}.exe
56+
if [ -f "$execfile" ]; then
57+
$execfile "$@"
58+
fi
59+
fi
5260

5361

5462

cic-core/cic-core.pro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030

3131
osx:DESTDIR = ../lib/darwin
3232
linux:DESTDIR = ../lib/linux
33+
win32:DESTDIR = ../lib/windows
3334

3435
#- Add coverage information
3536
QMAKE_CFLAGS += $$(CFLAGS)
36-
QMAKE_LFLAGS += $$(LDFLAGS)
37+
QMAKE_LFLAGS += $$(LDFLAGS)
3738

38-
TARGET = cic
39+
TARGET = cic
3940

4041
OBJECTS_DIR=build
4142
MOC_DIR=build
-58.5 KB
Binary file not shown.

cic-core/src/core/consoleoutput.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,36 @@ void ConsoleOutput::startComment(QTextStream &out,AnsiColor color){
3737
out.setFieldAlignment(QTextStream::AlignRight);
3838
out << " ";
3939
out.setFieldWidth(0);
40+
#ifndef _WIN32
4041
out << "\033[0;" << color << "m";
42+
#endif
4143
out.setFieldAlignment(QTextStream::AlignLeft);
4244
out.setFieldWidth(20);
4345
out.setPadChar(' ');
4446
}
4547

4648
void ConsoleOutput::endComment(QTextStream &out){
4749
out.setFieldWidth(1);
50+
#ifndef _WIN32
4851
out << "\033[0m" ;
52+
#endif
4953
out << endl;
5054
}
5155

5256
void ConsoleOutput::commentStartClass(QString cell){
5357
QTextStream out(stdout);
5458
out.setFieldWidth(0);
59+
#ifndef _WIN32
5560
out << "\033[1;" << green << "m";
61+
#endif
5662
out.setFieldAlignment(QTextStream::AlignLeft);
5763
out.setFieldWidth(20);
5864
out.setPadChar(' ');
5965
out << cell;
6066
out.setFieldWidth(1);
67+
#ifndef _WIN32
6168
out << "\033[0m" ;
69+
#endif
6270
out << endl;
6371

6472
}
@@ -69,7 +77,9 @@ void ConsoleOutput::endComment(QTextStream &out){
6977
out.setFieldAlignment(QTextStream::AlignRight);
7078
out << " ";
7179
out.setFieldWidth(0);
80+
#ifndef _WIN32
7281
out << "\033[0;" << color << "m";
82+
#endif
7383
out.setFieldAlignment(QTextStream::AlignLeft);
7484
out.setFieldWidth(0);
7585
out.setPadChar(' ');

cic-core/src/core/design.cpp

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,79 @@ namespace cIcCore{
5252
cellTranslator["Layout::LayoutCapCellSmall"] = "cIcCells::CapCell";
5353
nameTranslator["type"] = "mosType";
5454
console = new ConsoleOutput();
55+
readError = false;
56+
ignoreSetYoffsetHalf = false;
57+
58+
}
59+
60+
bool fexists(const char *filename)
61+
{
62+
if (FILE *file = fopen(filename, "r")) {
63+
fclose(file);
64+
return true;
65+
} else {
66+
return false;
67+
}
5568

5669
}
5770

71+
void Design::addIncludePath(QString filename)
72+
{
73+
_includePaths.append(filename);
74+
}
75+
76+
5877
bool Design::readCells(QString filename)
5978
{
6079
// Read file
6180
QString spice_file = filename;
6281
spice_file.replace(".json",".spi");
6382
_spice_parser.parseFile(spice_file);
83+
84+
console->comment("Reading '" + filename + "'",ConsoleOutput::green);
6485
QJsonObject obj = this->readJson( filename);
6586

87+
if(readError){
88+
return false;
89+
}
90+
91+
//Read options
92+
QJsonValue options = obj["options"];
93+
if(options.isObject()){
94+
QJsonObject opt = options.toObject();
95+
if(opt.contains("ignoreSetYoffsetHalf")){
96+
ignoreSetYoffsetHalf = opt["ignoreSetYoffsetHalf"].toBool();
97+
}
98+
}
99+
100+
101+
66102
//Read includes
67103
QJsonValue include = obj["include"];
68104
if(include.isArray()){
69105
QJsonArray includeArray = include.toArray();
70-
foreach (const QJsonValue & value, includeArray) {
106+
foreach (const QJsonValue & value, includeArray) {
71107
QString incfile = value.toString();
72-
this->readCells(incfile);
108+
qDebug() << incfile;
109+
110+
if(fexists(incfile.toStdString().c_str())){
111+
if(!this->readCells(incfile))
112+
{
113+
return false;
114+
115+
}
116+
117+
}
118+
119+
foreach (QString incpath,_includePaths){
120+
QString incf = QString("%1/%2").arg(incpath).arg(incfile);
121+
qDebug() << incf;
122+
if(fexists(incf.toStdString().c_str())){
123+
this->readCells(incf);
124+
}
125+
126+
}
127+
73128
}
74129

75130

@@ -390,7 +445,10 @@ namespace cIcCore{
390445

391446
foreach( QString key, jobj.keys()){
392447
if(re.match(key).hasMatch()){ continue;}
393-
448+
if( ignoreSetYoffsetHalf && key == "setYoffsetHalf"){continue;}
449+
450+
451+
394452
QString method_key = key;
395453
if(nameTranslator.contains(key)){
396454
method_key = nameTranslator[key];
@@ -508,6 +566,8 @@ namespace cIcCore{
508566
QJsonParseError err;
509567
QJsonDocument d = QJsonDocument::fromJson(val.toUtf8(),&err);
510568
if(QJsonParseError::NoError != err.error ){
569+
readError = true;
570+
511571
QString verr = val.mid(0,err.offset);
512572
int charcount =0;
513573
int line_count = 0;

0 commit comments

Comments
 (0)