Skip to content

Commit

Permalink
take description property from primitives. towards #13
Browse files Browse the repository at this point in the history
  • Loading branch information
drom committed Apr 1, 2020
1 parent fffe0f4 commit 4b22621
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/abstractionDefinition.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -45,7 +45,7 @@ const port = {
type: 'object',
required: ['description', 'wire'],
properties: {
description: {type: 'string'},
description,
wire: {
type: 'object',
required: ['onMaster', 'onSlave'],
Expand Down
9 changes: 6 additions & 3 deletions lib/component.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -28,8 +31,8 @@ const wire = {
]
},
analog: { enum: ['in', 'out', 'inout'] },
displayName: { type: 'string' },
description: { type: 'string' }
displayName,
description
}
}]
};
Expand Down
8 changes: 5 additions & 3 deletions lib/enumeratedValues.js
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions lib/field.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions lib/register.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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
Expand Down

0 comments on commit 4b22621

Please sign in to comment.