Comments (2)
Should be fixed now. The component entity class of the attribute specification was missing. Now your sample code works except it contains a syntax error with a comma at the last port mapping in Inst_sample2.
from rust_hdl.
Thanks for that. I tried it on the libraries today. There's another couple of EntityClass needed to successfully parse the common standard libraries Xilinx uses.
Here's an updated sample with examples of the other types I encountered:
entity sample1 is
port (
CLK : in std_logic;
nCLK : out std_logic
);
end entity;
architecture a of sample1 is
--From numeric_std.vhd line:1302
function "abs" (ARG: SIGNED) return SIGNED is
constant ARG_LEFT: INTEGER := ARG'LENGTH-1;
alias XARG: SIGNED(ARG_LEFT downto 0) is ARG;
variable RESULT: SIGNED(ARG_LEFT downto 0);
-- Exemplar synthesis directives :
attribute IS_SIGNED of ARG:constant is TRUE ;
attribute SYNTHESIS_RETURN of RESULT:variable is "ABS" ;
begin
if ARG'LENGTH < 1 then return NAS;
end if;
RESULT := TO_01(XARG, 'X');
if (RESULT(RESULT'LEFT)='X') then return RESULT;
end if;
if RESULT(RESULT'LEFT) = '1' then
RESULT := -RESULT;
end if;
return RESULT;
end "abs";
--From std_logic_1164.vhd:42
TYPE std_ulogic IS ( 'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'W', -- Weak Unknown
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care
);
ATTRIBUTE logic_type_encoding : string ;
ATTRIBUTE logic_type_encoding of std_ulogic:type is
('X','X','0','1','Z','X','0','1','X') ;
component sample2 is
port (
CLK : in std_logic;
nCLK : out std_logic
);
end component sample2;
attribute BOX_TYPE : string;
attribute BOX_TYPE of sample2 : component is "user_black_box";
begin
Inst_sample2 : sample2
port map (
CLK <= CLK,
nCLK <= nCLK
);
end a;
entity sample2 is
port (
CLK : in std_logic;
nCLK : out std_logic
);
end entity;
architecture a of sample2 is
signal s_nclk : std_logic;
begin
s_nclk <= not CLK;
nCLK <= s_nclk;
end a;
I've no experience in Rust, but based on your change last night I went ahead and added the additional entity classes and re-tested. I can now parse my whole project including the libraries. I'll add a pull request now.
from rust_hdl.
Related Issues (20)
- Emacs strange Unexpected EOF HOT 2
- Emacs getting stderr when restarting workspace
- [Feature Request] Support custom user-defined types/subtypes HOT 1
- aggregate as target does not flag when the same elements are assigned
- Don't allow declarations where they are not allowed
- Feature request: expose tokenizer in public API HOT 1
- [Enhancement] Associate high level syntax elements with their respective tokens HOT 5
- Avoid sending diagnostics for all files on every change HOT 2
- Autocompletion / Intellisense not working for function arguments starting with version 0.67.0 (VSCode) HOT 8
- Keep evaluating actuals for ports and generics even on failure.
- Case generate references
- Avoid reporting unused function declarations when constructing LUT HOT 2
- Public API for traversing the design hierarchy / AST HOT 25
- Add goto type declaration
- Add new TokenSpan information to DocumentSymbols
- Missing syntactical elements
- [Bug] Renaming a file in VSCode causes duplicate definition error with the "work" library name HOT 1
- Avoid reporting unused function declarations when constructing constant records HOT 2
- Create a dependency graph of a big project HOT 3
- [Enhancement] Improve results provided by WorkspaceSymbols
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust_hdl.