vhdl-language
Deep expertise in VHDL language constructs, IEEE 1076 standard compliance, and synthesis coding guidelines. Expert skill for generating synthesizable VHDL code.
What this skill does
# VHDL Language Skill
Expert skill for VHDL (VHSIC Hardware Description Language) development following IEEE 1076 standards. Provides deep expertise in synthesizable VHDL code generation, coding guidelines, and best practices for FPGA design.
## Overview
The VHDL Language skill enables comprehensive VHDL development for FPGA and ASIC designs, supporting:
- IEEE 1076-2019 standard compliance
- Synthesizable code generation
- Entity, architecture, package, and component declarations
- Synchronous process design with proper reset handling
- Vendor-specific synthesis attributes
- Testbench generation with assert statements
- Detection and fix of common coding anti-patterns
## Capabilities
### 1. Entity and Architecture Definition
Generate proper entity and architecture structures:
```vhdl
-- Example: Parameterized FIFO Entity
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity sync_fifo is
generic (
DATA_WIDTH : positive := 8;
DEPTH : positive := 16;
ALMOST_FULL_THRESHOLD : natural := 14;
ALMOST_EMPTY_THRESHOLD : natural := 2
);
port (
clk : in std_logic;
rst_n : in std_logic;
-- Write interface
wr_en : in std_logic;
wr_data : in std_logic_vector(DATA_WIDTH-1 downto 0);
full : out std_logic;
almost_full : out std_logic;
-- Read interface
rd_en : in std_logic;
rd_data : out std_logic_vector(DATA_WIDTH-1 downto 0);
empty : out std_logic;
almost_empty : out std_logic;
-- Status
fill_level : out unsigned(clog2(DEPTH) downto 0)
);
end entity sync_fifo;
architecture rtl of sync_fifo is
-- Type declarations
type ram_type is array (0 to DEPTH-1) of std_logic_vector(DATA_WIDTH-1 downto 0);
-- Signal declarations
signal ram : ram_type := (others => (others => '0'));
signal wr_ptr : unsigned(clog2(DEPTH)-1 downto 0) := (others => '0');
signal rd_ptr : unsigned(clog2(DEPTH)-1 downto 0) := (others => '0');
signal count : unsigned(clog2(DEPTH) downto 0) := (others => '0');
-- Function for ceiling log2
function clog2(n : positive) return natural is
variable result : natural := 0;
variable value : natural := n - 1;
begin
while value > 0 loop
result := result + 1;
value := value / 2;
end loop;
return result;
end function clog2;
begin
-- Architecture implementation
end architecture rtl;
```
### 2. Synchronous Process Design
Implement synchronous processes with proper reset handling:
```vhdl
-- Synchronous process with asynchronous reset
process(clk, rst_n)
begin
if rst_n = '0' then
-- Asynchronous reset - initialize all registers
wr_ptr <= (others => '0');
rd_ptr <= (others => '0');
count <= (others => '0');
elsif rising_edge(clk) then
-- Synchronous logic
if wr_en = '1' and full_i = '0' then
ram(to_integer(wr_ptr)) <= wr_data;
wr_ptr <= wr_ptr + 1;
end if;
if rd_en = '1' and empty_i = '0' then
rd_ptr <= rd_ptr + 1;
end if;
-- Update count
if (wr_en = '1' and full_i = '0') and not (rd_en = '1' and empty_i = '0') then
count <= count + 1;
elsif not (wr_en = '1' and full_i = '0') and (rd_en = '1' and empty_i = '0') then
count <= count - 1;
end if;
end if;
end process;
-- Synchronous process with synchronous reset
process(clk)
begin
if rising_edge(clk) then
if sync_rst = '1' then
-- Synchronous reset
state <= IDLE;
counter <= (others => '0');
else
-- Normal operation
state <= next_state;
counter <= counter + 1;
end if;
end if;
end process;
```
### 3. Package and Component Declarations
Create reusable packages and components:
```vhdl
-- Package declaration
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
package fpga_utils_pkg is
-- Constants
constant CLK_FREQ_HZ : natural := 100_000_000;
-- Type definitions
type axi_lite_master_t is record
awaddr : std_logic_vector(31 downto 0);
awvalid : std_logic;
wdata : std_logic_vector(31 downto 0);
wstrb : std_logic_vector(3 downto 0);
wvalid : std_logic;
bready : std_logic;
araddr : std_logic_vector(31 downto 0);
arvalid : std_logic;
rready : std_logic;
end record axi_lite_master_t;
constant AXI_LITE_MASTER_INIT : axi_lite_master_t := (
awaddr => (others => '0'),
awvalid => '0',
wdata => (others => '0'),
wstrb => (others => '0'),
wvalid => '0',
bready => '0',
araddr => (others => '0'),
arvalid => '0',
rready => '0'
);
-- Function declarations
function clog2(n : positive) return natural;
function max(a, b : integer) return integer;
function min(a, b : integer) return integer;
-- Component declarations
component sync_fifo is
generic (
DATA_WIDTH : positive := 8;
DEPTH : positive := 16
);
port (
clk : in std_logic;
rst_n : in std_logic;
wr_en : in std_logic;
wr_data : in std_logic_vector(DATA_WIDTH-1 downto 0);
full : out std_logic;
rd_en : in std_logic;
rd_data : out std_logic_vector(DATA_WIDTH-1 downto 0);
empty : out std_logic
);
end component sync_fifo;
end package fpga_utils_pkg;
-- Package body
package body fpga_utils_pkg is
function clog2(n : positive) return natural is
variable result : natural := 0;
variable value : natural := n - 1;
begin
while value > 0 loop
result := result + 1;
value := value / 2;
end loop;
return result;
end function clog2;
function max(a, b : integer) return integer is
begin
if a > b then return a; else return b; end if;
end function max;
function min(a, b : integer) return integer is
begin
if a < b then return a; else return b; end if;
end function min;
end package body fpga_utils_pkg;
```
### 4. Vendor-Specific Synthesis Attributes
Apply synthesis directives for Xilinx and Intel:
```vhdl
-- Xilinx synthesis attributes
architecture rtl of my_design is
-- ASYNC_REG for synchronizers
signal sync_reg : std_logic_vector(1 downto 0);
attribute ASYNC_REG : string;
attribute ASYNC_REG of sync_reg : signal is "TRUE";
-- Keep hierarchy for debugging
attribute KEEP_HIERARCHY : string;
attribute KEEP_HIERARCHY of rtl : architecture is "YES";
-- RAM style control
signal block_ram : ram_type;
attribute RAM_STYLE : string;
attribute RAM_STYLE of block_ram : signal is "block";
signal dist_ram : small_ram_type;
attribute RAM_STYLE of dist_ram : signal is "distributed";
-- Register duplication for fanout
signal high_fanout_reg : std_logic;
attribute MAX_FANOUT : integer;
attribute MAX_FANOUT of high_fanout_reg : signal is 50;
-- FSM encoding
type state_type is (IDLE, RUNNING, DONE);
signal state : state_type;
attribute FSM_ENCODING : string;
attribute FSM_ENCODING of state : signal is "one_hot";
begin
-- Implementation
end architecture rtl;
-- Intel/Altera synthesis attributes
architecture rtl of my_design is
-- RAM inference control
signal ram : ram_type;
attribute ramstyle : string;
attribute ramstyle of ram : signal is "M20K";
-- Preserve signal
signal debug_sig : std_logic;
attribute preserve : boolean;
attribute preserve of debug_sig : signal is true;
begin
-- Implementation
end architecture rtl;
```
### 5. Numeric_std Best Practices
Use numeric_std library correctly (avoid std_logic_arith):
```vhdl
-- CORRECT: Using numeric_std
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all; -- Preferred library
architecture rtl of example is
signal counter : unsigned(7 downto 0);
signal signed_val : signed(15 downto 0);
begin
-- Arithmetic with unsigned
counter <= counter + 1;
counter <= counter + to_unsigned(10, counter'length);
-- Conversion from std_logic_vector
counter <= unsigned(input_slv);
-Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.