aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAki Van Ness <aki@yosyshq.com>2022-08-02 07:23:45 -0400
committerAki Van Ness <aki@yosyshq.com>2022-08-02 07:23:45 -0400
commite3074c044a113d9f03877ac94ca5641101e4f883 (patch)
tree37748ffba75272eb939cb61b953667f03bba1629
parent4f0ee383c9b48174c916540d7aa1eb624a4a9a25 (diff)
downloadyosys-e3074c044a113d9f03877ac94ca5641101e4f883.tar.gz
yosys-e3074c044a113d9f03877ac94ca5641101e4f883.tar.bz2
yosys-e3074c044a113d9f03877ac94ca5641101e4f883.zip
misc: Added JNY schema definition
-rw-r--r--misc/jny.schema.json193
1 files changed, 193 insertions, 0 deletions
diff --git a/misc/jny.schema.json b/misc/jny.schema.json
new file mode 100644
index 000000000..0fff8ee57
--- /dev/null
+++ b/misc/jny.schema.json
@@ -0,0 +1,193 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://raw.githubusercontent.com/YosysHQ/yosys/master/misc/jny.schema.json",
+ "title": "Yosys JSON Netlist metadata",
+ "description": "Yosys JSON Netlist",
+ "type": "object",
+ "properties": {
+ "generator": {
+ "type": "string",
+ "description": "JNY File Generator"
+ },
+ "version": {
+ "type": "string",
+ "description": "JNY Version"
+ },
+ "invocation": {
+ "type": "string",
+ "description": "Invocation line that generated the JNY metadata"
+ },
+ "features": {
+ "type": "array",
+ "description": "What information is contained in the JNY file",
+ "items": {
+ "type": "string"
+ }
+ },
+ "modules": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/module" }
+ }
+ },
+ "required": [
+ "generator",
+ "version",
+ "invocation",
+ "features"
+ ],
+ "$defs": {
+ "module": {
+ "type": "object",
+ "description": "Module definition",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Module Name"
+ },
+ "cell_sorts": {
+ "type": "array",
+ "description": "",
+ "items": { "$ref": "#/$defs/cell_sort" }
+ },
+ "connections": {
+ "type": "array",
+ "description": "Cell connections",
+ "items": { "$ref": "#/$defs/connection" }
+ },
+ "attributes": {
+ "type": "object",
+ "description": "Attributes attached to the module"
+ },
+ "parameters": {
+ "type": "object",
+ "description": "Parameters attached to the module"
+ }
+ },
+ "required": [
+ "name",
+ "cell_sorts"
+ ]
+ },
+ "cell_sort": {
+ "type": "object",
+ "description": "Describes a type of cell",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of cell"
+ },
+ "ports": {
+ "type": "array",
+ "description": "Cell ports",
+ "items": { "$ref": "#/$defs/port" }
+ }
+ ,
+ "cells": {
+ "type": "array",
+ "description": "Cells of cell_sort",
+ "items": { "$ref": "#/$defs/cell" }
+ }
+ },
+ "required": [
+ "type",
+ "ports",
+ "cells"
+ ]
+ },
+ "connection": {
+ "type": "object",
+ "description": "A connection within a module or cell",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Connection name"
+ },
+ "signals": {
+ "type": "array",
+ "description": "Signals that compose the connection",
+ "items": { "$ref": "#/$defs/signal" }
+ }
+ },
+ "required": [
+ "name",
+ "signals"
+ ]
+ },
+ "port": {
+ "type": "object",
+ "description": "Cell port description",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Port name"
+ },
+ "direction": {
+ "type": "string",
+ "description": "Port direction",
+ "enum": ["i", "o", "io", ""]
+ },
+ "range": {
+ "type": "array",
+ "description": "Port width [MSB, LSB]",
+ "items": {
+ "type": "number"
+ },
+ "minContains": 1,
+ "maxContains": 2
+ }
+ },
+ "required": [
+ "name",
+ "direction",
+ "range"
+ ]
+ },
+ "cell": {
+ "type": "object",
+ "description": "Module cell definition",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Cell name"
+ },
+ "connections": {
+ "type": "array",
+ "description": "Cell connections",
+ "items": { "$ref": "#/$defs/connection" }
+ },
+ "attributes": {
+ "type": "object",
+ "description": "Attributes attached to the cell"
+ },
+ "parameters": {
+ "type": "object",
+ "description": "Parameters attached to the cell"
+ }
+ },
+ "required": [
+ "name"
+ ]
+ },
+ "signal": {
+ "type": "object",
+ "description": "A signal definition",
+ "parameters": {
+ "width": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": ["wire", "chunk"]
+ },
+ "const": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "width",
+ "type",
+ "const"
+ ]
+ }
+ }
+}