Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 05 2021 13:29

    umarcor on top-subtype

    (compare)

  • Oct 05 2021 13:28

    umarcor on master

    2008: ad tb_top_generic_subtype cosim: add ref to aguinet/drago… (compare)

  • Sep 24 2021 20:07

    umarcor on top-subtype

    2008: ad tb_top_generic_subtype (compare)

  • Sep 24 2021 19:59

    umarcor on top-subtype

    2008: ad tb_top_generic_subtype (compare)

  • Sep 24 2021 19:54

    umarcor on top-subtype

    2008: ad tb_top_generic_subtype (compare)

  • Sep 23 2021 01:45

    umarcor on style

    (compare)

  • Sep 23 2021 01:44

    umarcor on run_08

    (compare)

  • Sep 21 2021 23:02

    umarcor on merge-support

    (compare)

  • Sep 21 2021 22:59

    umarcor on master

    merge run_support.py into run.py (compare)

  • Sep 21 2021 22:51

    umarcor on merge-support

    merge run_support.py into run.py (compare)

  • Sep 21 2021 22:34

    umarcor on master

    style deprecate Travis (compare)

  • Sep 21 2021 22:10

    umarcor on style

    test (compare)

  • Sep 21 2021 21:51

    umarcor on style

    deprecate Travis TMP -k (compare)

  • Sep 21 2021 21:47

    umarcor on style

    style deprecate Travis TMP -k (compare)

  • Sep 21 2021 21:32

    umarcor on style

    pathlib support (compare)

  • Sep 21 2021 21:18

    umarcor on runner-string

    (compare)

  • Sep 21 2021 21:18

    umarcor on style

    pathlib (compare)

  • Sep 21 2021 21:12

    umarcor on style

    style (compare)

  • Sep 21 2021 19:48

    umarcor on master

    vhdl_2008: style use type 'string' for top-level… (compare)

  • Sep 21 2021 19:34

    umarcor on runner-string

    use type 'string' for top-level… (compare)

Richard Head
@trickyhead_gitlab

Question re: VHDL 2019. With the following generic specification:

generic (
  type designated_subtype; -- any type
  type access_type is access designated_subtype -- an access type
 );

Would it be required that both types here be mapped to existing types, or can the access type here be left "open" as it is a fully defined type once designated_subtype is assigned? for example, this is effectively the example given in 6.5.3.3

generic map (
 designated_subtype => string,
 access_type => line
 );

Would it also be legal to do the following:

generic map (
 designated_subtype => string
 );

Now access_type is a fully defined type that exists only within the same region as the generic. It is NOT type lineas this was not mapped.

I cannot find anything in 6.5.7.2 that appears to require the type be assigned an actual type.

Jim Lewis
@JimLewis

@trickyhead_gitlab I think maybe the other way around may be allowed. From type line, you can find its designated_subtype using attributes.

However, without mapping type line, access_type would then have to be a unique type and if you wanted anything in the package to have a parameter or return value that is type access_type, then its type will not be known outside the package.

BTW have you found a tool that has implemented this yet? Hopefully in October.
Richard Head
@trickyhead_gitlab
@JimLewis No - I provided a test case to Aldec as I requested the feature.
An idea I have likely matches exactly what you said - if the user provides the access type, they can return a value in a known type. If they do not care about the access type, it remains a unique type, used internally only
I requested generic array types and generic access types. I actually want a generic access type of a generic array type (with the base type discoverable via 'element)
In most of my imagined use cases, the access type is not required externally, but its nice to have for completness
GlenNicholls
@GlenNicholls
Richard Head
@trickyhead_gitlab

@JimLewis Actually, LRM says this:

It is an error if no such actual is specified for a given formal generic type (either because the formal generic is unassociated or because the actual is open).

So I guess they cannot be left unconnected (and maybe its worth filing a ticket)

Patrick Lehmann
@Paebbels
@trickyhead_gitlab the problem with VHDL is types are equal if the name of a type is equal.

When you define this:

type line1 is access string;
type line2 is access string;

you get 2 incompatible types.

Thus you need to handover the access type to the protected type, entity or package as a generic type, so you can use it internally as access type or extract from it it's designated type.
To simplify your code, you can remove the designated_type generic, because the access_type holds all needed information.
See the example given in P2 in the LRM.
Patrick Lehmann
@Paebbels
package P2 is
  generic (
    type access_type is access type is private
  );

  alias designated_subtype is access_type'DESIGNATED_SUBTYPE;
end package;
architecture A of E is
  package I2 is new P2
    generic map (
      access_type => line
    );
begin
end architecture;
Richard Head
@trickyhead_gitlab
but why cant the type be formed in the generic region, if a type is left "open" . There is no object created yet, hence is doesnt have to have a value like a normal generic. Also, simply writing type t; is legal as a forward type declaration, but it requires the complete type at a later point in the same unit
I am aware that no connecting the access type makes a brand new type and its not compatable, and thats my point - why shouldnt you be able to do this? inside the package (or other region) you have no care or knowledge of what the type actually is. You cannot have code that is conditional based on type.
Jim Lewis
@JimLewis
@trickyhead_gitlab
Why not just:
package P2 is
generic (
  type designated_subtype
 );
  type fred is access designated_subtype ;
I think you have a choice, either the access type is a type externally defined and you need to create a package that uses it - or - the type is an internally defined type that is unique.
I don't think you can have either depending on how you use it.
Patrick Lehmann
@Paebbels
@trickyhead_gitlab but then you're at the solution @JimLewis provided, right?
Just the type and the definition of the access type is inside the package or protected type.
Richard Head
@trickyhead_gitlab
Next VHDL 2019 question - should a subtype be able to define the generic map of a generic protected type?
Patrick Lehmann
@Paebbels
protected types get instantiated like a package instantiation.
type tricky_pt is new protected pt
  generic map (
    ....
  );
It's a (new) type, and no subtype, because instances of PT are not compatible to each other.
Richard Head
@trickyhead_gitlab
Yes - I read more - you cannot subtype a protected type because a protected type instantiation becomes it's own distinct type. I guess that avoids having "similar" protected types and dodgy casting
Patrick Lehmann
@Paebbels
yes :)
Benedikt J
@beja.65536_gitlab
Hi everyone, is there an example for using the GHDL plugin in Yosys with multiple files? So far, I found a couple of examples but all use a single VHDL file. If I try to add multiple files the usual way (first analyse them via ‘-a’, then elaborate via ‘-e’), I get an error message that option ‘-a’ is not supported.
xiretza
@xiretza:xiretza.xyz
[m]

either create a library file first, then run ghdl-yosys-plugin on that:

ghdl analyze file1.vhdl file2.vhdl subdir/file3.vhdl
ghdl elaborate topentity
yosys -m ghdl -p 'ghdl topentity'

or run ghdl-yosys-plugin directly on the files, without creating a library file:

yosys -m ghdl -p 'ghdl file1.vhdl file2.vhdl subdir/file3.vhdl -e topentity'

in general, the yosys ghdl command is equivalent to invoking the ghdl binary as ghdl --synth.

eine
@eine

Actually, there is another solution in-between:

ghdl analyze file1.vhdl file2.vhdl subdir/file3.vhdl
yosys -m ghdl -p 'ghdl -e topentity'

That is useful if the files are analysed in a library different to the top-level, but you don't care about the logical lib name of the top-level:

ghdl analyze --work=designlib file1.vhdl file2.vhdl subdir/file3.vhdl
yosys -m ghdl -p 'ghdl toplevel.vhd -e topentity'
Furthermore, we have discussed about supporting a single line syntax which allows defining multiple libraries at once. That would work for both synthesis and elab-run.
eine
@eine
So maybe (NOT SUPPORTED YET):
# Synthesis
yosys -m ghdl -p 'ghdl --work=designlib file1.vhdl file2.vhdl subdir/file3.vhdl --work=anyother toplevel.vhd -e topentity'

# Analysis and Elaboration
ghdl -a \
  --work=designlib file1.vhdl file2.vhdl subdir/file3.vhdl \
  --work=anyother toplevel.vhd testbench.vhd \
  -e topentity

# elab-run
ghdl elab-run \
  --work=designlib file1.vhdl file2.vhdl subdir/file3.vhdl \
  --work=anyother toplevel.vhd testbench.vhd \
  -e topentity \
  --wave=mywave.ghw
Benedikt J
@beja.65536_gitlab
Many thanks to both of you! I’ll give it a try and let you know if it worked :-)
d3jones
@d3jones
LRM 2019 12.3: "Within the specification of a subprogram, every declaration with the same designator as the subprogram is hidden." Can someone provide an example showing hiding due to this requirement? Everything I try in GHDL seems to compile without complaint.
Is this legal?
entity test is
end test;

architecture rtl of test is

    function f return real is
        function f return real is
        begin
            return 3.14;
        end f;
    begin
        return f;
    end f;
begin
    process
    begin
        report real'image(f);
        wait;
    end process;
end rtl;
Patrick Lehmann
@Paebbels
If the outer f wouldn't be hidden, it would call it self recursively.
tgingold
@tgingold
Something like procedure p (arg : integer := arg);, where arg is already declared.
d3jones
@d3jones
How is 12.3 applicable here? arg does not have the same designator as any subprogram.
d3jones
@d3jones
And this is already illegal by LRM 2000 4.3.2.1. I cannot find equivalent text in 2019 LRM.
tgingold
@tgingold
Sorry. So something like:
  function f return real;
  function f return integer is
  begin
    return integer(real'(f));
  end f;
Lars Asplund
@LarsAsplund
A bit of history. Had a discussion on LinkedIn today with Cliff Berg who is a co-founder of https://www.agile2academy.com, an author of books about Agile and generally involved in the topic. Turns out that he has a background in VHDL.
I was on the team that created VHDL. I was probably the first person to actually write VHDL, since my task on the team was to write VHDL and see how usable it was.
Obviously he thought it was useful enough so here we are....
Jim Lewis
@JimLewis
@LarsAsplund Did you mention to him that the VHDL WG would welcome his participation :)
OneWingedShark
@OneWingedShark_gitlab
@d3jones - :point_up: July 20, 2021 7:48 AM - Your nested F-function looks to me like it would be an ambiguous call and, if it is, should be illegal.
Lars Asplund
@LarsAsplund
@JimLewis I did not. I think he went on to Java shortly after and then management. A lost soul 😀
d3jones
@d3jones
@OneWingedShark_gitlab possibly true, but GHDL accepts it, and reports 3.14, without complaint.