mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 03:06:42 +01:00
Assembly library started
This commit is contained in:
@@ -204,8 +204,18 @@ function buildComponentsArray(ctx) {
|
||||
const ccodes = [];
|
||||
ccodes.push(`Circom_Component _components[${ctx.components.length}] = {\n`);
|
||||
for (let i=0; i< ctx.components.length; i++) {
|
||||
let newThread;
|
||||
if (ctx.newThreadTemplates) {
|
||||
if (ctx.newThreadTemplates.test(ctx.components[i].template)) {
|
||||
newThread = "true";
|
||||
} else {
|
||||
newThread = "false";
|
||||
}
|
||||
} else {
|
||||
newThread = "false";
|
||||
}
|
||||
ccodes.push(i>0 ? " ," : " ");
|
||||
ccodes.push(`{${ctx.components[i].htName},${ctx.components[i].etName},${ctx.components[i].fnName}, ${ctx.components[i].nInSignals}, true}\n`);
|
||||
ccodes.push(`{${ctx.components[i].htName},${ctx.components[i].etName},${ctx.components[i].fnName}, ${ctx.components[i].nInSignals}, ${newThread}}\n`);
|
||||
}
|
||||
ccodes.push("};\n");
|
||||
const codeComponents = ccodes.join("");
|
||||
|
||||
@@ -41,7 +41,7 @@ async function compile(srcFile, options) {
|
||||
ctx.field = new ZqField(options.p);
|
||||
ctx.verbose= options.verbose || false;
|
||||
ctx.mainComponent = options.mainComponent || "main";
|
||||
|
||||
ctx.newThreadTemplates = options.newThreadTemplates;
|
||||
|
||||
constructionPhase(ctx, srcFile);
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ function execFunctionCall(ctx, ast) {
|
||||
if (ast.name == "log") {
|
||||
const v = exec(ctx, ast.params[0]);
|
||||
const ev = val(ctx, v, ast);
|
||||
console.log(ev.toString());
|
||||
console.log(ev.v.toString());
|
||||
return;
|
||||
}
|
||||
if (ast.name == "assert") {
|
||||
@@ -691,7 +691,7 @@ function execPin(ctx, ast) {
|
||||
}
|
||||
const sIdx = ctx.components[cIdx].names.getSignalIdx(ast.pin.name, selsP);
|
||||
|
||||
if (sIdx<0) ctx.throwError(ast, "Signal not defined:" + buildFullName() );
|
||||
if (sIdx<0) return ctx.throwError(ast, "Signal not defined:" + buildFullName() );
|
||||
return {
|
||||
t: "S",
|
||||
sIdx: sIdx,
|
||||
|
||||
Reference in New Issue
Block a user