Skip to content

DuH validate not handling verbose port definitions #87

Open
@seldridge

Description

@seldridge

duh validate assumes that ports are an object with keys. However, ports can be objects or an array of verbose objects.

This will result in duh validate rejecting ports described in the verbose syntax because, I think, this is trying to index with a string into an array.

E.g., the following fails:

{
  "component":{
    "vendor":"Vendor",
    "library":"Library",
    "name":"Name",
    "version":"0.0.1",
    "busInterfaces":[
      {
        "name":"name",
        "interfaceMode":"master",
        "busType":{
          "vendor":"Vendor",
          "library":"Library",
          "name":"Name",
          "version":"0.0.1"
        },
        "associations":[
        ],
        "abstractionTypes":[
          {
            "viewRef":"RTLview",
            "portMaps":{
              "FOO":[
                "out"
              ]
            }
          }
        ]
      }
    ],
    "addressSpaces":[
    ],
    "memoryMaps":[
    ],
    "model":{
      "views":[
      ],
      "ports":[
        {
          "name":"out",
          "wire":{
            "direction":"in",
            "width":8,
            "description":"the input",
            "isClock":false
          }
        }
      ]
    },
    "fileSets":{
      "Hdl":[

      ]
    }
  }
}
error: name:FOO mapped to not existing port: out

While the following, equivalent description passes:

{
  "component":{
    "vendor":"Vendor",
    "library":"Library",
    "name":"Name",
    "version":"0.0.1",
    "busInterfaces":[
      {
        "name":"name",
        "interfaceMode":"master",
        "busType":{
          "vendor":"Vendor",
          "library":"Library",
          "name":"Name",
          "version":"0.0.1"
        },
        "associations":[
        ],
        "abstractionTypes":[
          {
            "viewRef":"RTLview",
            "portMaps":{
              "FOO":[
                "out"
              ]
            }
          }
        ]
      }
    ],
    "addressSpaces":[
    ],
    "memoryMaps":[
    ],
    "model":{
      "views":[
      ],
      "ports":{
          "out": "8"
      }
    },
    "fileSets":{
      "Hdl":[

      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions