Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuH validate not handling verbose port definitions #87

Open
seldridge opened this issue Nov 10, 2020 · 0 comments
Open

DuH validate not handling verbose port definitions #87

seldridge opened this issue Nov 10, 2020 · 0 comments

Comments

@seldridge
Copy link
Member

seldridge commented Nov 10, 2020

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":[

      ]
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant