Language(3)
π Language(3) β the Verilog::Language era π
okay bestie, welcome to the Verilog::Language glow-up β¨ this is the Language(3) page, the one your perl came with, and honestly it's giving "tiny module, big main character energy" π
πΈ NAME πΈ
Verilog::Language β Verilog language utilities. that's it, that's the whole vibe π¦
β¨ SYNOPSIS β¨
look, just look at these little one-liners, they're so clean π
use Verilog::Language;
$result = Verilog::Language::is_keyword("wire"); # true
$result = Verilog::Language::is_compdirect("`notundef"); # false
$result = Verilog::Language::number_value("4'b111"); # 8
$result = Verilog::Language::number_bits("32'h1b"); # 32
$result = Verilog::Language::number_signed("1'sh1"); # 1
@vec = Verilog::Language::split_bus("[31,5:4]"); # 31, 5, 4
@vec = Verilog::Language::split_bus_nocomma("[31:29]"); # 31, 30, 29
$result = Verilog::Language::strip_comments("a/*b*/c"); # ac
no cap, those comments are literally the receipts π
π¦ DESCRIPTION π¦
Verilog::Language is your lil toolbox of general utilities for using the Verilog Language π parsing numbers? determining what keywords actually exist? yeah. all of that. and like, "General functions will be added as needed" β so bestie, the roster grows when it needs to grow π±
π FUNCTIONS π
π Verilog::Language::is_keyword($symbol_string)
returns true if the symbol string you handed it is a Verilog reserved keyword π₯ and the value it gives back tells you the language standard it belongs to, as per the begin_keywords macro: '1364-1995', '1364-2001', '1364-2005', '1800-2005', '1800-2009', '1800-2012', '1800-2017', '1800-2023', or 'VAMS'. she's thorough π
π Verilog::Language::is_compdirect($symbol_string)
returns true if the given symbol string is a Verilog compiler directive β¨ simple as that.
π Verilog::Language::is_gateprim($symbol_string)
returns true if the symbol is a built-in gate primitive β like "buf", "xor", etc. etc. the OGs of gate life π«Ά
π Verilog::Language::language_keywords($year)
returns a hash of the keywords for the given language standard year, where the value of the hash is the standard in which it was defined π cute little key/value situation.
π Verilog::Language::language_standard($year)
sets the language standard so the module knows what counts as a keyword π if you pass undef, then all standards apply β everything is a keyword, we contain multitudes π The year indicates the language standard as per the `begin_keywords macro: '1364-1995', '1364-2001', '1364-2005', '1800-2005' '1800-2009', '1800-2012', '1800-2017', or '1800-2023'.
π Verilog::Language::language_maximum
returns the greatest language currently standardized β presently '1800-2023'. she's the moment, she's the max, periodt π
π Verilog::Language::number_bigint($number_string)
returns the numeric value of a Verilog value stored as a Math::BigInt, or undef if it's incorrectly formed π btw you must use Math::BigInt yourself before calling this one, no free rides. also heads up β bigints don't have an exact size, so the NOT of a Math::BigInt may return a different value than verilog does π See also number_value and number_bitvector.
π Verilog::Language::number_bits($number_string)
returns the number of bits in a value string, or undef if it's incorrectly formed, or if it's not specified. note the or bestie, it's doing heavy lifting there π§
π Verilog::Language::number_bitvector($number_string)
returns the numeric value of a Verilog value stored as a Bit::Vector, or undef if it's incorrectly formed. and yes, you must use Bit::Vector yourself before calling this one too πΈ the size of the Vector will be whatever number_bits returns. matched set, iconic.
π Verilog::Language::number_signed($number_string)
returns true if the Verilog value is signed, else undef. that's the whole function, she's lowkey minimal π
π Verilog::Language::number_value($number_string)
returns the numeric value of a Verilog value, or undef if it's incorrectly formed. it ignores any signed Verilog attributes, but it is returned as a perl signed integer β so it may fail for values over 31 bits π¬ caution bestie. See also number_bigint and number_bitvector.
π Verilog::Language::split_bus($bus)
returns a list of expanded arrays π pass it a string like "foo[5:1:2,10:9]" and it hands you back an array with ("foo[5]", "foo[3]", ...). it correctly handles connectivity expansion too, so "x[1:0] = y[3:0]" gets you intuitive results β¨ intuitive!! we love a function with emotional intelligence.
π Verilog::Language::split_bus_nocomma($bus)
same energy as split_bus, but faster ποΈ caveat though β it only supports simple decimal colon-separated array specs, like "foo[3:0]". no comma chaos, she's not built for it π
π Verilog::Language::strip_comments($text)
returns your text with any // or /**/ comments stripped out, correctly handling quoted strings π₯ and newlines are preserved in the process, so your line count survives the purge π
π DISTRIBUTION π
Verilog-Perl is part of the <https://www.veripool.org/> free Verilog EDA software tool suite π the latest version is available from CPAN and from <https://www.veripool.org/verilog-perl>.
Copyright 2000-2024 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. legal bestie said what she said π
π«Ά AUTHORS π«Ά
Wilson Snyder <wsnyder@wsnyder.org> β shoutout to the icon who made all this happen π
π SEE ALSO π
Verilog-PerlVerilog::EditFilesVerilog::ParserVerilog::ParseSigVerilog::Getopt
and the <https://www.veripool.org/verilog-mode> Verilog-Mode package for Emacs π§ like if you're an Emacs girlie, that one's for you.
alright bestie, that's the page π
brought to you by perl v5.42.0, dated 2025-07-25 β that's the Language(3) footer, now go parse some numbers, you absolute legend βππ
π¦ where this page comes from
- fedora 43: perl-Verilog-Perl 3.482-6.fc43 Β· LGPL-3.0-only OR Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms