Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions hardware/epfl-2027-round3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# epfl 2027, round three

Five LUT-6 size netlists for the EPFL combinational benchmark suite, submitted to lsils/benchmarks, each with a complete proof that runs against the original circuit.

| row | LUT-6 / levels | check |
| --- | ---: | --- |
| max, size | 510 / 129 | stock ABC `cec` against `max.aig` and `max.blif` (plus `check_max.py`) |
| sin, size | 587 / 84 | `check_sin.c`: evaluates the netlist and `sin.aig` on all 2^24 inputs (0 differ) |
| log2, size | 4,007 / 216 | `check_cuda.cu` (or `check.c`): evaluates the netlist and `log2.aig` on all 2^32 inputs (0 differ) |
| multiplier, size | 3,147 / 111 | cutpoint certificate (`./run.sh`): 12 stock ABC `cec` pieces (5-piece `multiplier.aig` bridge + 7 netlist pieces) |
| square, size | 1,900 / 97 | cutpoint certificate (`./run.sh`): 8 stock ABC `cec` pieces (4-piece `square.aig` bridge + 4 netlist pieces) |

Counts are `nd` and `lev` from stock ABC `print_stats`.

Each folder's `CHECK.md` gives the function, the command, and its expected output; the two cutpoint certificate folders (`multiplier-size` and `square-size`) also include `CERTIFICATE.md` and `SHA256SUMS`. To run all five:

```sh
EPFL_DIR=/path/to/benchmarks ./run_all.sh
```

`REQUIREMENTS.md` lists what the checkers need. `EPFL_DIR` is a checkout of https://github.com/lsils/benchmarks.
17 changes: 17 additions & 0 deletions hardware/epfl-2027-round3/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Requirements

- `python3` (Python 3.9+ standard library only).
- Stock Berkeley `abc` (or `yosys-abc`, override via `ABC=/path/to/abc`).
- `cc` (standard C99 compiler with `-lpthread` and `-lm`, used by `check_sin.c` and CPU `check.c`).
- `nvcc` + CUDA GPU (optional; used by `check_cuda.cu` to check all 2^32 inputs of `log2` in 81.79 s on one NVIDIA L4 GPU; without a GPU, `run_all.sh` falls back to `check.c` on CPU).
- `EPFL_DIR` environment variable pointing to a checkout of https://github.com/lsils/benchmarks, containing:
- `arithmetic/max.aig` and `arithmetic/max.blif`
- `arithmetic/sin.aig`
- `arithmetic/log2.aig`
- `arithmetic/multiplier.aig`
- `arithmetic/square.aig`

Usage:
```sh
EPFL_DIR=/path/to/benchmarks ABC=/path/to/abc ./run_all.sh
```
30 changes: 30 additions & 0 deletions hardware/epfl-2027-round3/log2-size/CHECK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# `log2-size`

The fixed-point binary logarithm of `arithmetic/log2.aig`, with a 32-bit input and a 32-bit output, matching `arithmetic/log2.aig` on all 2^32 inputs.

- SHA-256 (`log2_size_2027.blif.gz`): `076bc016daaa1256b0eeb051ba67f2421f353a799395211d05d112825f5a1bf6`
- SHA-256 (uncompressed `log2_size_2027.blif`): `96429b83f7a646b8f629a4bc8765cd689d13988bcce7f81c4292bd2efa712c33`

Full 2^32 exhaustive command (CUDA GPU, 81.79 s on one NVIDIA L4):
```sh
gunzip -c log2_size_2027.blif.gz > /tmp/log2_size_2027.blif && \
abc -c "read_blif /tmp/log2_size_2027.blif; print_stats" && \
nvcc -O3 -o /tmp/check_cuda check_cuda.cu && \
/tmp/check_cuda "$EPFL_DIR/arithmetic/log2.aig" /tmp/log2_size_2027.blif
```

Expected output:
```text
top : i/o = 32/ 32 lat = 0 nd = 4007 edge = 23818 cube = 56885 lev = 216
=== /tmp/log2_size_2027.blif ===
benchmark: 32060 AND nodes (1236 live slots). netlist: 4007 LUTs, at most 6 inputs each, 216 levels (117 live slots).
input words 0x00000000 to 0xffffffff (4294967296 words) checked in 81.79 s
netlist against benchmark: 0 differ
```

CPU alternative (all 2^32 inputs via `check.c`):
```sh
gunzip -c log2_size_2027.blif.gz > /tmp/log2_size_2027.blif && \
cc -O3 -o /tmp/check_log2 check.c -lpthread && \
/tmp/check_log2 "$EPFL_DIR/arithmetic/log2.aig" /tmp/log2_size_2027.blif tables.json 8
```
318 changes: 318 additions & 0 deletions hardware/epfl-2027-round3/log2-size/check.c

Large diffs are not rendered by default.

403 changes: 403 additions & 0 deletions hardware/epfl-2027-round3/log2-size/check_cuda.cu

Large diffs are not rendered by default.

Binary file not shown.
1 change: 1 addition & 0 deletions hardware/epfl-2027-round3/log2-size/tables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"description": "EPFL log2 reference: coefficient tables read from the netlist; address A = x[30:23]", "widths": {"M2": 36, "C2": 40, "C1": 41, "C0": 36}, "M2": [65708650043, 64946002228, 64195202276, 63455943217, 62727894402, 62011089118, 61305066288, 60609663662, 59924931181, 59250229987, 58585814442, 57931251572, 57286350789, 56651040883, 56025087790, 55408291092, 54800524415, 54201516192, 53611450685, 53029719800, 52456337394, 51891350680, 51334395353, 50785266829, 50244059809, 49710590329, 49184526686, 48665911818, 48154487767, 47650279836, 47153045971, 46662660177, 46179184702, 45702408417, 45231946871, 44767985341, 44310438266, 43859122668, 43413825909, 42974530684, 42541207692, 42113641291, 41691875968, 41275611883, 40864946311, 40459617396, 40059815743, 39665036978, 39275432366, 38891026353, 38511632044, 38137165232, 37767466727, 37402648564, 37042280927, 36686815385, 36335705143, 35989097028, 35646934398, 35309024389, 34975391528, 34645984995, 34320633567, 33999349470, 33682074046, 33368831892, 33059321468, 32753661155, 32451876949, 32153726383, 31859142485, 31568257513, 31280743271, 30996809966, 30716329108, 30439182595, 30165377027, 29894823546, 29627499666, 29363387601, 29102325900, 28844461217, 28589551170, 28337741173, 28088691611, 27842778487, 27599534259, 27359249468, 27121603237, 26886839350, 26654609870, 26425269655, 26198392123, 25974348927, 25752503216, 25533332143, 25316637130, 25102497946, 24890565905, 24681150357, 24474018528, 24269266133, 24066739439, 23866476549, 23668339055, 23472443474, 23278758125, 23087155045, 22897689946, 22710252255, 22524831437, 22341553111, 22160051991, 21980640354, 21803024432, 21627528735, 21453796344, 21281960660, 21111853920, 20943762631, 20777355279, 20612716810, 20449578404, 20288324143, 20128819780, 19971106140, 19814763554, 19660113103, 19507192570, 19355829470, 19205820340, 19057557661, 18910801577, 18765501184, 18621744230, 18479395284, 18338540090, 18199111587, 18061036607, 17924349554, 17789060095, 17655169690, 17522645465, 17391350158, 17261437021, 17132748003, 17005316723, 16879195814, 16754276446, 16630756884, 16508371981, 16387027854, 16266997660, 16148077613, 16030390977, 15913733124, 15798321006, 15683972274, 15570714353, 15458596836, 15347470020, 15237614977, 15128547367, 15020616621, 14913705195, 14807825396, 14702922473, 14599045272, 14496010570, 14394104981, 14293135884, 14193029528, 14093929365, 13995763471, 13898389754, 13801967293, 13706425700, 13611839661, 13518101480, 13425162115, 13333104271, 13241833490, 13151542013, 13061878653, 12973187653, 12885213527, 12798086512, 12711673721, 12626127022, 12541239517, 12457103343, 12373858119, 12291156188, 12209388049, 12128234425, 12047852994, 11968234431, 11889184679, 11810888454, 11733188539, 11656174833, 11580047198, 11504410152, 11429499613, 11355152248, 11281570696, 11208505562, 11136131765, 11064373891, 10993177074, 10922639140, 10852640977, 10783445001, 10714640919, 10646529490, 10578851064, 10511782547, 10445317233, 10379489508, 10314177473, 10249396902, 10185040590, 10121349804, 10058058426, 9995468171, 9933304626, 9871732388, 9810549691, 9750027090, 9689727521, 9630197529, 9571033843, 9512481834, 9454235486, 9396612743, 9339285129, 9282434494, 9226176838, 9170280730, 9114857592, 9059878253, 9005398087, 8951353804, 8897649952, 8844379975, 8791652202, 8739299769, 8687290516, 8635784011, 8584539117, 8533860222, 8483499314, 8433590217, 8384049974, 8334799338, 8286077471], "C2": [951378511115, 952526945754, 953661938657, 954783816552, 955892948205, 956989151080, 958073001207, 959144622685, 960203813299, 961251440326, 962286989719, 963311017963, 964323709172, 965325062312, 966315335148, 967294736396, 968263360206, 969221535461, 970168863108, 971106218251, 972033481443, 972950477766, 973857702031, 974755395085, 975643309728, 976521655474, 977390889957, 978250855323, 979101893647, 979943878353, 980777130439, 981601780323, 982417642363, 983224992614, 984024406512, 984815494471, 985598326255, 986373140520, 987140230814, 987899556768, 988651098655, 989395161758, 990131600760, 990860873140, 991582743461, 992297608076, 993005066755, 993705950526, 994399931610, 995086905288, 995767145427, 996440744695, 997107932860, 997768450991, 998423023097, 999070773753, 999712645026, 1000348316905, 1000977840592, 1001601520066, 1002219260187, 1002831105059, 1003437324335, 1004037847800, 1004632737680, 1005221900411, 1005805857866, 1006384342504, 1006957259364, 1007525024666, 1008087724155, 1008645062471, 1009197627253, 1009744973836, 1010287308365, 1010824819490, 1011357455369, 1011885350226, 1012408510035, 1012926931703, 1013440895642, 1013950076330, 1014454916367, 1014955092113, 1015451244197, 1015942588704, 1016430025873, 1016912940554, 1017391944970, 1017866515270, 1018337323280, 1018803617482, 1019266233834, 1019724383056, 1020179338535, 1020630093532, 1021077025925, 1021519941314, 1021959533396, 1022395132900, 1022827195722, 1023255494821, 1023680324776, 1024101579434, 1024519524478, 1024933888614, 1025344712410, 1025752242133, 1026156334566, 1026557201162, 1026954840897, 1027348959641, 1027740320334, 1028128227032, 1028513292249, 1028894789163, 1029273470734, 1029649024897, 1030021797319, 1030391137741, 1030757752728, 1031121435109, 1031482760339, 1031840857867, 1032196003944, 1032548086354, 1032898024063, 1033245080915, 1033589151498, 1033930604376, 1034269882277, 1034606079177, 1034939719465, 1035270901707, 1035599408206, 1035925531273, 1036249057381, 1036570123362, 1036888881616, 1037205236818, 1037519150220, 1037830601809, 1038139651679, 1038446604985, 1038751088143, 1039053456328, 1039353616249, 1039651428796, 1039947136165, 1040240253388, 1040531394613, 1040820771180, 1041107717847, 1041392707443, 1041675430722, 1041956366216, 1042234977999, 1042511692661, 1042786431334, 1043059060483, 1043329931819, 1043598346474, 1043865476135, 1044130454038, 1044393555864, 1044654739271, 1044914127591, 1045171588223, 1045427564705, 1045681333217, 1045933360966, 1046183821861, 1046432345937, 1046679101958, 1046924437373, 1047167941283, 1047409780642, 1047649755340, 1047888127992, 1048125013862, 1048360192401, 1048593895184, 1048825619291, 1049056256831, 1049284912923, 1049512236227, 1049737881025, 1049962182496, 1050184737004, 1050406073998, 1050625945313, 1050843975985, 1051061068448, 1051276188839, 1051490167951, 1051702581976, 1051913446243, 1052123267208, 1052331546978, 1052538695982, 1052744467240, 1052948316844, 1053151295685, 1053352763813, 1053553152989, 1053751909109, 1053949698384, 1054146040277, 1054341131652, 1054535114919, 1054727716411, 1054919254381, 1055109002373, 1055298078678, 1055485650557, 1055672426628, 1055857912862, 1056042120384, 1056224946352, 1056406722460, 1056587398816, 1056767269244, 1056945652916, 1057123289012, 1057299324066, 1057474523090, 1057648416204, 1057821567721, 1057993205544, 1058164564547, 1058334085441, 1058502909757, 1058670331387, 1058837220300, 1059002659939, 1059167588231, 1059331477911, 1059493987753, 1059655780702, 1059816529514, 1059976313353, 1060134965618, 1060292664954, 1060449685619, 1060605750130, 1060760534979, 1060914524447, 1061067809319, 1061219914171, 1061371546906, 1061521801824, 1061671408949, 1061819966157, 1061967715597, 1062114890073, 1062260769902], "C1": [296844506139, 295691590344, 294547735001, 293412714845, 292286257516, 291168648959, 290059400687, 288958481269, 287866195306, 286781741784, 285705745223, 284637719941, 283577562898, 282525363800, 281480939503, 280444155502, 279414996649, 278393196093, 277379263203, 276372342606, 275372640311, 274380424914, 273395239531, 272416897455, 271445743644, 270481625120, 269524112283, 268573450673, 267629333096, 266691970269, 265761074381, 264836567144, 263918725003, 263007305512, 262101722553, 261202480599, 260309565640, 259422769381, 258541817027, 257666815151, 256797847471, 255934620616, 255077362385, 254225597838, 253379658837, 252539137036, 251704559793, 250875000964, 250050900537, 249232437663, 248419340104, 247611549424, 246808840794, 246011577093, 245218933122, 244432019310, 243649740919, 242872534781, 242100386825, 241332970922, 240570450032, 239812816154, 239059780204, 238311473429, 237567862659, 236829109634, 236094602409, 235364718906, 234639622698, 233918828982, 233202268301, 232490357720, 231782385897, 231078961516, 230379860048, 229684876660, 228994116171, 228307442081, 227624883524, 226946481755, 226271905485, 225601618322, 224935073209, 224272732866, 223613782388, 222959297805, 222308113901, 221661085341, 221017424604, 220377868376, 219741542988, 219109496933, 218480629099, 217856044808, 217234037238, 216616011196, 216001480396, 215390743297, 214782871481, 214178818913, 213577983034, 212980708177, 212386611819, 211795869814, 211208136111, 210623819036, 210042889696, 209465026563, 208890458991, 208318912312, 207750412989, 207185408412, 206622828798, 206063698738, 205507159771, 204954287922, 204404017168, 203856823964, 203312227375, 202771202340, 202232738173, 201697160966, 201163642755, 200633490843, 200106321243, 199582324865, 199060153467, 198540924472, 198024819357, 197511307568, 196999740786, 196491505934, 195985832966, 195482591789, 194982133432, 194484032151, 193988633667, 193495748337, 193005160513, 192517035062, 192031450773, 191548458129, 191067983202, 190589568742, 190113814851, 189640184453, 189168840189, 188700018433, 188233355415, 187769635447, 187307905091, 186847842602, 186390522042, 185935207206, 185482408839, 185031376056, 184582985550, 184136567394, 183692263755, 183250306805, 182810141214, 182372919919, 181936748417, 181503054834, 181071404123, 180641880639, 180214295996, 179788883463, 179364922894, 178943627881, 178524238815, 178106478620, 177690978248, 177277470407, 176865384663, 176455423687, 176047320171, 175641426084, 175237310890, 174834790892, 174434253166, 174035315679, 173638850979, 173243344289, 172850342213, 172458743002, 172069154022, 171681008077, 171295016005, 170910270914, 170527214060, 170146512461, 169766600744, 169389299804, 169013164858, 168638951328, 168266644941, 167895361064, 167525990576, 167157815827, 166791285227, 166427381713, 166064240269, 165703014588, 165342940577, 164985024740, 164628077421, 164272975165, 163919372596, 163567020555, 163216425814, 162867018528, 162520136045, 162173743255, 161829374057, 161485736160, 161143746088, 160803393939, 160464880629, 160127601695, 159791657843, 159456509385, 159123434090, 158791060337, 158460994614, 158131812357, 157804404831, 157477717106, 157153215211, 156828570392, 156506745621, 156185584029, 155866437472, 155547654518, 155230993903, 154914667622, 154599692162, 154286733820, 153974524088, 153663701006, 153354119494, 153046110819, 152739336645, 152433269286, 152128455488, 151825536645, 151523573467, 151222393004, 150922937104, 150623817992, 150326829873, 150030537945, 149735745353, 149441978780, 149148780129, 148857590841], "C0": [24592715715, 24978520804, 25362783405, 25745555799, 26126907282, 26506718290, 26885132411, 27262138787, 27637610845, 28011802614, 28384477377, 28755781837, 29125731296, 29494273829, 29861453048, 30227296213, 30591788810, 30955005954, 31316746533, 31677296366, 32036563404, 32394431797, 32751047344, 33106459771, 33460525447, 33813281405, 34164867157, 34515175075, 34864300959, 35212149551, 35558810412, 35904296069, 36248486074, 36591454096, 36933405019, 37274132635, 37613625565, 37951946663, 38289185308, 38625285457, 38960199252, 39294024434, 39626657581, 39958268123, 40288712132, 40618134539, 40946313676, 41273599613, 41599805365, 41924845386, 42248813319, 42571718515, 42893637427, 43214410718, 43534357530, 43853015975, 44170815822, 44487567118, 44803262282, 45118021960, 45431766830, 45744487363, 46056290606, 46367110150, 46676947456, 46985722522, 47293679381, 47600648159, 47906547546, 48211570187, 48515734574, 48818852020, 49121214349, 49422550584, 49722945174, 50022475172, 50321084582, 50618821592, 50915662935, 51211579807, 51506706436, 51800829314, 52094178057, 52386538569, 52678260888, 52968858244, 53258837942, 53547809709, 53836115547, 54123415681, 54410093160, 54695665638, 54980620912, 55264448152, 55547914399, 55830371120, 56112030609, 56392746336, 56672936615, 56952153065, 57230664946, 57508303780, 57785238593, 58061378959, 58336878522, 58611537563, 58885360568, 59158490683, 59430811227, 59702444171, 59973369138, 60243364148, 60512932979, 60781577075, 61049701119, 61316778322, 61583315372, 61849074201, 62114281182, 62378453176, 62642075564, 62904981748, 63167572301, 63429196691, 63690035725, 63949986507, 64209711833, 64468650039, 64726702301, 64984126247, 65241241584, 65497344229, 65752814207, 66007710887, 66261849588, 66515439912, 66768299189, 67020517360, 67272198672, 67523252472, 67773631687, 68023303410, 68272299065, 68520849859, 49161138, 296459885, 543178900, 789188126, 1034672298, 1279211859, 1523303002, 1767111679, 2010062928, 2252541557, 2494269580, 2735642461, 2976185174, 3216251029, 3455758358, 3694576059, 3932998973, 4170395987, 4407790854, 4644401999, 4880460650, 5115915210, 5350863691, 5585172486, 5819233848, 6052372220, 6285001677, 6517271636, 6748826136, 6979808379, 7210532922, 7440601841, 7670159901, 7899003542, 8127370247, 8355359629, 8582747880, 8809747257, 9035855651, 9261932724, 9487089886, 9711953148, 9936169277, 10160060380, 10383211578, 10606142862, 10828595085, 11050175136, 11271790301, 11492373812, 11712765309, 11932518216, 12151635597, 12370634604, 12588986085, 12807110358, 13024738276, 13241279939, 13457840669, 13673729279, 13889398484, 14104240966, 14318966827, 14533045167, 14746679768, 14960017738, 15172748348, 15385213581, 15596594795, 15808128424, 16018874603, 16229620780, 16439802118, 16649420068, 16858346050, 17066949012, 17275163483, 17483321679, 17690626107, 17897926945, 18104218062, 18310385460, 18515867451, 18721323137, 18925826433, 19130842953, 19334497700, 19538150805, 19740941298, 19943915820, 20145951168, 20348185191, 20549966372, 20750862806, 20951685186, 21152020532, 21351958840, 21551282315, 21750206027, 21949069971, 22147516687, 22345123974, 22542500629, 22739757947, 22936275571, 23132961906, 23328633724, 23524232524, 23719225168, 23913921485, 24108623418, 24302370141]}
19 changes: 19 additions & 0 deletions hardware/epfl-2027-round3/max-size/CHECK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# `max-size`

The four-way signed maximum and its two-bit index of `arithmetic/max.aig` (512 inputs, 130 outputs).

- SHA-256 (`max_size_2027.blif`): `b7d806a7223423dc253139b99b23b628a6718ce92290ae9f016dd6f0fc76b01b`

Command:
```sh
abc -c "read_blif max_size_2027.blif; print_stats" && \
abc -c "cec $EPFL_DIR/arithmetic/max.aig max_size_2027.blif" && \
python3 check_max.py max_size_2027.blif "$EPFL_DIR/arithmetic/max.blif" "$EPFL_DIR/arithmetic/max.aig" abc
```

Expected output:
```text
top : i/o = 512/ 130 lat = 0 nd = 510 edge = 2552 cube = 2940 lev = 129
Networks are equivalent. Time = 0.65 sec
{'ok': True, 'sim_4096_signed128': True, 'abc_cec_blif': True, 'abc_cec_aig': True, 'luts': 510, 'sha256': 'b7d806a7223423dc253139b99b23b628a6718ce92290ae9f016dd6f0fc76b01b'}
```
Loading
Loading