diff --git a/lib/abstractionDefinition.js b/lib/abstractionDefinition.js index 7d9664d..c96f24d 100644 --- a/lib/abstractionDefinition.js +++ b/lib/abstractionDefinition.js @@ -1,6 +1,6 @@ 'use strict'; -const {name, version, vendor, library} = require('./primitive.js'); +const {name, version, vendor, library, description} = require('./primitive.js'); const meta = require('ajv/lib/refs/json-schema-draft-06.json'); const props = { @@ -45,7 +45,7 @@ const port = { type: 'object', required: ['description', 'wire'], properties: { - description: {type: 'string'}, + description, wire: { type: 'object', required: ['onMaster', 'onSlave'], diff --git a/lib/component.js b/lib/component.js index 7c10e21..c93d2cc 100644 --- a/lib/component.js +++ b/lib/component.js @@ -1,6 +1,9 @@ 'use strict'; -const {name, version, vendor, library, uint, access} = require('./primitive.js'); +const { + name, version, vendor, library, + uint, access, description, displayName +} = require('./primitive.js'); const register = require('./register.js'); const registerFile = require('./registerFile.js'); const busInterface = require('./busInterface'); @@ -28,8 +31,8 @@ const wire = { ] }, analog: { enum: ['in', 'out', 'inout'] }, - displayName: { type: 'string' }, - description: { type: 'string' } + displayName, + description } }] }; diff --git a/lib/enumeratedValues.js b/lib/enumeratedValues.js index 1f9fb9c..6c6ec53 100644 --- a/lib/enumeratedValues.js +++ b/lib/enumeratedValues.js @@ -1,14 +1,16 @@ 'use strict'; -const {id, int} = require('./primitive.js'); +const { + id, int, description, displayName +} = require('./primitive.js'); const enumeratedValue = { type: 'object', required: ['name', 'value'], properties: { name: id, - description: { type: 'string' }, - displayName: { type: 'string' }, + description, + displayName, // usage value: int } diff --git a/lib/field.js b/lib/field.js index 909eceb..a72ec1d 100644 --- a/lib/field.js +++ b/lib/field.js @@ -1,6 +1,6 @@ 'use strict'; -const {id, uint, int, access, expression} = require('./primitive.js'); +const {id, uint, int, access, expression, description} = require('./primitive.js'); const enumeratedValues = require('./enumeratedValues.js'); const modifiedWriteValue = { @@ -30,7 +30,7 @@ const field = { required: ['name', 'bitOffset', 'bitWidth'], properties: { name: id, - description: { type: 'string' }, + description, bitOffset: {oneOf: [expression, uint]}, // base % regWidth in bits resetValue: int, // ipxactish // resetMask // ipxactish diff --git a/lib/register.js b/lib/register.js index 71e113f..a12485b 100644 --- a/lib/register.js +++ b/lib/register.js @@ -1,6 +1,9 @@ 'use strict'; -const {id, uint, int, access, expression} = require('./primitive.js'); +const { + id, uint, int, access, expression, + description, displayName +} = require('./primitive.js'); const field = require('./field.js'); const register = { @@ -11,8 +14,8 @@ const register = { addressOffset: {oneOf: [expression, uint]}, // in memoryMaps[?].addressUnitBits size: {oneOf: [expression, uint]}, // regWidth in bits access: access, - displayName: { type: 'string' }, - description: { type: 'string' }, + displayName, + description, fields: { type: 'array', items: field