semvec/pypi-packages huggingface dataset:
pyralgen 1.0.1
Python based UVM-RAL generator
Requires Python: >=3.9

# pyralgen

`pyralgen` is a lightweight Python-based UVM-RAL code generator. It leverages the
[SystemRDL](https://www.accellera.org/downloads/standards/systemrdl) standard to describe
the register specifications and extends the [PeakRDL-uvm](https://github.com/SystemRDL/PeakRDL-uvm)
framework to include build-in register coverage support.

## Features

- UVM-RAL code generation with automatic coverage model insertion
- Template-driven: easily extend or override code templates
- Industry best practices: idiomatic, maintainable SystemVerilog output
- Configurable: enable or disable coverage, factory usage, and more via CLI options

## Prerequisites

- Python 3.9.21 or later.

## Installing

**Note:** `pyralgen` is still under active development.

Clone the repository and set up the Python environment :

```bash
# Clone project
git clone https://github.com/cirofabianbermudez/pyralgen.git
cd pyralgen

# Bootstrap Python venv and install deps
./scripts/setup/setup_python_env.sh
source .venv/bin/activate

# Verify installation
pyuvcgen -h
```

## Example

The easiest way to use `pyralgen` is via the command line tool:

```bash
# Generate UVM-RAL
pyralgen -c registers.rdl -o ral_regs_pkg.sv
```

## Integration

Inside the `top_env.sv` make sure to **enable coverage models for register model** before
creating the register model and **enable sampling of coverage** after building the register
model.

```verilog
class top_env extends uvm_env;

  `uvm_component_utils(top_env)

  function void top_env::build_phase(uvm_phase phase);
    ...
    if (regmodel == null) begin

      // Enable Coverage models for register model <- Add this
      uvm_reg::include_coverage("*", UVM_CVR_ALL);

      // Create and build the register model
      regmodel = ral_reg_block::type_id::create("regmodel", this);
      uvm_config_db #(ral_reg_block)::set(this, "", "regmodel", regmodel);
      regmodel.build();

      // Enable sampling of coverage               <- Add this
      if (m_config.coverage_enable) begin
        regmodel.set_coverage(UVM_CVR_ALL);
      end

      // Lock and reset
      regmodel.lock_model();
      regmodel.reset()
    end
```

## Development

1. Clone de repository and navigate to its root directory:

    ```bash
    git clone https://github.com/cirofabianbermudez/pyralgen.git
    cd pyuvcgen
    ```

2. Create a Python virtual environment and install dependencies:

    ```bash
    ./script/setup/setup_python_env.sh
    source .venv/bin/activate
    ```

3. Verify installation:

    ```bash
    pyuvcgen -h
    ```

## License

## Contributing

Contributions, issues, and feature requests are welcome! Feel free to check issues or submit a pull request.
better-is-numeric 2.0.1
An enhancement of str.isnumeric()

# numerical

Python library I made to learn regex and to have a better version of str.isnumeric()

PyPI rejected the name without telling me why (too similar to numerics?), so its called better-is-numeric there.

Supports decimals and negative numbers, managed by flags.

Even if you don't need to support decimals or negative numbers, this is
still better than str.isnumeric(), since that function for some reason
counts exponents (⅐, for example) as numeric.

Should work down to Python 3.9.

Importing is kind of ugly, maybe I'll fix it one day. In the meantime, you can avoid this and the PyPI name by just downloading the code from the Codeberg repository and putting it in the same directory as your program, for a simple `from numerical import *`

Here's some example code:

```python
from is_numeric.numerical import *

print(is_numeric("1", NM_ALLOW_NEGATIVE, NM_ALLOW_DECIMALS, NM_ALLOW_LEADING_ZERO))
```

This will print True, since the NM_ALLOW flags do not require, they only allow.
If you want to REQUIRE a negative number or decimals, simply check:

`if "-" in whatever_string_you_are_checking`

`if "." in whatever_string_you_are_checking`

I've copied this from the docstring(?) of the function, since it describes the flags:

```
This function uses a "flag" system to control what's allowed and what isn't.
You can pass these as individual arguments, you don't need a list or set or anything.
Certain flags switch the function to dictionary output, to include whatever data you requested.
The simple boolean output is still included in the dictionary output, in the "numeric" field.
The flags are in variables, but you can also use their string values.
1: NM_ALLOW_NEGATIVE - Set to the string "AN", this flag allows negative numbers.
2: NM_ALLOW_DECIMALS - Set to the string "AD", this flag allows numbers with decimals.
3: NM_ALLOW_LEADING_ZERO - Set to the string "AZ", this flag allows "invalid" numbers like 01.
4: NM_ALLOW_PLUS_SIGN - Set to the string "AP", this flag allows explicitly positive numbers, such as +2.
5: NM_RETURN_REGEX - Set to the string "RX", this flag uses dictionary output and returns the constructed regex inside the "regex" field.
```

If you want no flags, just don't give any.
That is, JUST give the string. `is_numeric(string)`