diff options
| author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2022-01-24 16:02:29 +0100 | 
|---|---|---|
| committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2022-01-28 23:34:41 +0100 | 
| commit | 93508d58dafbbffcedffa70b21a197b6fca8bb30 (patch) | |
| tree | 4f4bed22749559a1938457015ff875891fd7a40a /passes/tests | |
| parent | db33b1e535f5ee93dba9ee1cc181b91c482a4dee (diff) | |
| download | yosys-93508d58dafbbffcedffa70b21a197b6fca8bb30.tar.gz yosys-93508d58dafbbffcedffa70b21a197b6fca8bb30.tar.bz2 yosys-93508d58dafbbffcedffa70b21a197b6fca8bb30.zip | |
Add $bmux and $demux cells.
Diffstat (limited to 'passes/tests')
| -rw-r--r-- | passes/tests/test_cell.cc | 46 | 
1 files changed, 45 insertions, 1 deletions
| diff --git a/passes/tests/test_cell.cc b/passes/tests/test_cell.cc index 4e437e409..e21ec452c 100644 --- a/passes/tests/test_cell.cc +++ b/passes/tests/test_cell.cc @@ -69,6 +69,48 @@ static void create_gold_module(RTLIL::Design *design, RTLIL::IdString cell_type,  		cell->setPort(ID::Y, wire);  	} +	if (cell_type == ID($bmux)) +	{ +		int width = 1 + xorshift32(8); +		int swidth = 1 + xorshift32(4); + +		wire = module->addWire(ID::A); +		wire->width = width << swidth; +		wire->port_input = true; +		cell->setPort(ID::A, wire); + +		wire = module->addWire(ID::S); +		wire->width = swidth; +		wire->port_input = true; +		cell->setPort(ID::S, wire); + +		wire = module->addWire(ID::Y); +		wire->width = width; +		wire->port_output = true; +		cell->setPort(ID::Y, wire); +	} + +	if (cell_type == ID($demux)) +	{ +		int width = 1 + xorshift32(8); +		int swidth = 1 + xorshift32(6); + +		wire = module->addWire(ID::A); +		wire->width = width; +		wire->port_input = true; +		cell->setPort(ID::A, wire); + +		wire = module->addWire(ID::S); +		wire->width = swidth; +		wire->port_input = true; +		cell->setPort(ID::S, wire); + +		wire = module->addWire(ID::Y); +		wire->width = width << swidth; +		wire->port_output = true; +		cell->setPort(ID::Y, wire); +	} +  	if (cell_type == ID($fa))  	{  		int width = 1 + xorshift32(8); @@ -855,8 +897,10 @@ struct TestCellPass : public Pass {  		cell_types[ID($logic_and)] = "ABSY";  		cell_types[ID($logic_or)]  = "ABSY"; +		cell_types[ID($mux)] = "*"; +		cell_types[ID($bmux)] = "*"; +		cell_types[ID($demux)] = "*";  		if (edges) { -			cell_types[ID($mux)] = "*";  			cell_types[ID($pmux)] = "*";  		} | 
