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

Prepare first release candidate #5

Open
wants to merge 51 commits into
base: release
Choose a base branch
from
Open

Prepare first release candidate #5

wants to merge 51 commits into from

Conversation

Paebbels
Copy link
Member

@Paebbels Paebbels commented Jul 4, 2020

This will add:

  • AMBA
    • AXI4
    • AXI4-Lite
    • AXI4-Stream
  • Common interfaces
    • Tristate
    • Differential signaling
    • Differential lane
  • PoC
    • CSE
  • Low-speed I/O buses
    • I²C
    • I²S
    • SPI
    • JTAG
    • UART
  • Video
    • VGA
    • MIPI C-PHY
    • MIPI D-PHY
    • MIPI M-PHY
  • Ethernet
    • MII
    • GMII
    • RGMII
    • XGMII
    • SGMII
  • Cages
    • SFP
    • QSFP

@Paebbels Paebbels added Low-Speed I/O Low-speed I/O interface Common Interface Common I/O interface Serial Interface Serial communication interface External Mainly external interface between ICs on a PCB or similar. labels Jul 4, 2020
@Paebbels Paebbels self-assigned this Jul 4, 2020
This file has been successfully checked by Riviera-PRO 2020.04.
This file has been successfully checked by Riviera-PRO 2020.04.
This file has been successfully checked by Riviera-PRO 2020.04.
@Paebbels Paebbels marked this pull request as ready for review July 4, 2020 12:47
@Paebbels
Copy link
Member Author

Paebbels commented Jul 4, 2020

This will add some of the interfaces listed in #6.

IO/Common.vhdl Outdated Show resolved Hide resolved
Copy link

@LarsAsplund LarsAsplund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again some very high-level comments without diving into the actual standards

alias SFP_CageView is SFP_ICView'converse;

type SFP_Interface_Vector is
array(natural range <>)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I think we should use integer ranges. I find the natural ranges of some of the standard vector types limiting at times. Can't come up with a good example for negative indices here but I don't think we should add such a restriction unless we have very good reasons for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As natural is a subtype of integer, the range could be extended later if a usecase requires it. Such a change is backward compatible.


-- Tristate (3-state) interface
type Tristate_Interface is record
I : std_logic; -- Input

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a need to comment the meaning of an identifier the identifier should probably be renamed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question for the whole repository should be if we:

  • follow original naming of standards, because many developers might be used to such naming.
  • minimally cleaning up names to unify naming across interfaces and packages in that repository
  • fully cleaning up all names

use IEEE.std_logic_1164.all;

-- Signal name mappings
-- SCK -> Serial Clock; alternatives: BCLK

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another example when I think we can use the full name rather than the abbreviation. Assuming we accept the interface to standar mismatch (I do)

-- RX -> Receive Data (RxD)
package UART is
type UART_Interface is record
RX : std_logic;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example where I think the abbreviation is very well established/understood.

PoC/CSE.vhdl Outdated
-- =============================================================================
-- Authors: Patrick Lehmann
--
-- Generic Package: VHDL-2019 Command-Status-Error interface description

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this according to some standard?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a commonly used interface in the PoC library - hence the path to the package. It's used in layered designs in combination with hierarchical state machines.

@Paebbels
Copy link
Member Author

@LarsAsplund, @JimLewis, @lievenlemiengre, @cmarqu, @umarcor, @nickg, @BAHayhoe, @pblecua, @martinjthompson, @brimdavis, @Nic30, @NJDFan, @tgingold, @M-KraftKugler, @MortenZdk, @tmeissner, @yyde, @marlonjames, @bradleyharden

There is now support for "interfaces" in Xilinx Vivado 2023.1 - so a first synthesis tool can use this stuff. I tested the code and except for some minor syntax updates, it was accepted by the tool.

AXI4-Lite
image

@tgingold
Copy link

At many places, you create an alias of the converse attribute of a mode view.

I don't think this is allowed by the LRM, as you can only alias a named entity.
(Even if this is used in an example of the LRM).

Probably the LRM needs to be fixed.

@Paebbels
Copy link
Member Author

@tgingold

From LRM 6.6 Alias:

An object alias is an alias whose alias designator denotes an object (i.e., a constant, a variable, a signal, or a file). A nonobject alias is an alias whose alias designator denotes some named entity other than an object. An alias can be declared for all named entities except for labels, loop parameters, and generate parameters.

So, alias to views fall under nonobject alias.
Now the question is, what is a named alias?

From LRM 7.2 Attribute Specification, we know that named entities can be decorated with attributes. That' allowed for:

entity_class ::=
entity
| architecture
| configuration
| procedure
| function
| package
| type
| subtype
| constant
| signal
| variable
| component
| label
| literal
| units
| group
| file
| property
| sequence
| view

In LRM 16.2.5 Predefined attributes of named entities, we see attribute 'simple_name refers to LRM 7.2 for what is a list of named entities.

In Glossary we find:

named entity: An item associated with an identifier, character literal, or operator symbol as the result of an explicit or implicit declaration. (6.1) See also: name.

What would be missing to use an alias with a view returned from an attribute?

@Paebbels
Copy link
Member Author

Oh, it's not listed in 6.1 Declarations → General.

@tgingold
Copy link

tgingold commented May 22, 2023 via email

@Paebbels
Copy link
Member Author

I created https://gitlab.com/IEEE-P1076/VHDL-Issues/-/issues/293 to adjust the LRM.

@nickg
Copy link

nickg commented May 22, 2023

So what should a conforming VHDL-2019 implementation do here: error on an alias of 'converse as required by the LRM or allow it as a special exception?

@Paebbels
Copy link
Member Author

@nickg I think an error is not needed, as views where added in many places like LRM 7.2 to allow such an alias. Also by writing examples and adding a 'converse attribute the LCS writers (Jim, me, others) intended to allow aliases to such attributes. Without an alias this attribute is almost meaningless.

Also the discussion in http://www.eda-twiki.org/cgi-bin/view.cgi/P1076/LCS2016_045c shows clearly the intentions by the the LCS authors to allow aliases.

So we should consider this an LRM bug / oversight and fix it in the next revision. That's why I created an issue in the LRM repository.

If your tool has a special mode / flag to allow non LRM (fully) compliant features, you could activate aliases in such a feature and keep your tool "pedantic" (that's how commercial tools call there inverse flag) until the LRM is fixed.

@nickg does this answer help you and your tool?

@JimLewis
Copy link

If your tool has a special mode / flag to allow non LRM (fully) compliant features, you could activate aliases in such a feature and keep your tool "pedantic" (that's how commercial tools call there inverse flag) until the LRM is fixed.

There is no benefit to requiring a "pedantic" flag for this. Based on the examples and referenced discussions, it is clear that the LRM committee intended that this feature be a named entity. Hence, I recommend that the LRM is interpreted as if views were included in the list of declarations in 6.1.

The problem with a pedantic off flag for this is that other things may also be allowed by the pedantic off flag that are not desired.

@JimLewis
Copy link

JimLewis commented May 22, 2023

Isn't it a problem in the LRM that we have that bullet list in 6.1 and the bnf for entity_class. Aren't these redundant. It seems the LRM would benefit of the definition of entity_class were to replace the bullet list of 6.1 for the definition of named entity.

Redundant things are hard to maintain.

@Paebbels
Copy link
Member Author

As I specified the change to entity_class in the LCS, I was not aware of a needed change to LRM 6.1.

@nickg
Copy link

nickg commented May 29, 2023

The master branch of nickg/nvc has some preliminary support for interfaces. I'd welcome any testing/feedback.


package Common is
-- Differential signaling (DS or LVDS)
type Differatial_Interface is record
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
type Differatial_Interface is record
type Differential_Interface is record

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'll search where I used that type elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Interface Common I/O interface External Mainly external interface between ICs on a PCB or similar. Low-Speed I/O Low-speed I/O interface Serial Interface Serial communication interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants