P4C
The P4 Compiler
Loading...
Searching...
No Matches
IXBarRandom Struct Reference

Compiler generated random number function for use as hash seed on the input crossbar. More...

#include <input_xbar.h>

Static Public Member Functions

static unsigned nextRandomNumber (unsigned numBits=1)
 

Static Public Attributes

static std::uniform_int_distribution< unsigned > distribution1
 Uniform distribution producing either a 0 or a 1.
 
static std::uniform_int_distribution< unsigned > distribution10
 Uniform distribution producing a 10-bit random number.
 
static std::mt19937 mersenne_generator
 
static unsigned seed = 0x0572f1fa
 
static std::random_device seed_generator
 

Detailed Description

Compiler generated random number function for use as hash seed on the input crossbar.

Member Function Documentation

◆ nextRandomNumber()

unsigned IXBarRandom::nextRandomNumber ( unsigned numBits = 1)
static
Returns
a new random number which can be represented by numBits. If numBits != 10 or numBits != 12, then this function returns a random bit.

Member Data Documentation

◆ seed

unsigned IXBarRandom::seed = 0x0572f1fa
static

Copyright (C) 2024 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPDX-License-Identifier: Apache-2.0