Comparing version 0.0.51 to 0.0.52
@@ -19,2 +19,3 @@ /** | ||
var Gate = require('./Gate'); | ||
var Pin = require('./Pin'); | ||
@@ -75,2 +76,9 @@ /** | ||
} | ||
/** | ||
* Returns HDL code for this built-in gate. | ||
* | ||
* Describes inputs/outputs with the BUILTIN <Name> part. | ||
*/ | ||
}, { | ||
@@ -117,2 +125,23 @@ key: 'eval', | ||
}], [{ | ||
key: 'getHDLCode', | ||
value: function getHDLCode() { | ||
if (!this._hdlCode) { | ||
var spec = this.Spec; | ||
var docBlock = spec.description.split('\n').map(function (line) { | ||
return ' * ' + line; | ||
}); | ||
var inputs = spec.inputPins.map(function (pin) { | ||
return Pin.toFullName(pin); | ||
}).join(', '); | ||
var outputs = spec.outputPins.map(function (pin) { | ||
return Pin.toFullName(pin); | ||
}).join(', '); | ||
this._hdlCode = '/**\n' + docBlock + '\n */\nCHIP ' + this.name + ' {\n IN ' + inputs + ';\n OUT ' + outputs + ';\n\n BUILTIN ' + this.name + ';\n}'; | ||
} | ||
return this._hdlCode; | ||
} | ||
}, { | ||
key: 'validateSpec', | ||
@@ -119,0 +148,0 @@ value: function validateSpec(spec) { |
{ | ||
"name": "hdl-js", | ||
"version": "0.0.51", | ||
"version": "0.0.52", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Hardware definition language (HDL) and Hardware simulator", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
304522
5657