Line 283... |
Line 283... |
@soc.cores[ :inst_b ] = SOCMaker::CoreInst.new( "core_bv1" )
|
@soc.cores[ :inst_b ] = SOCMaker::CoreInst.new( "core_bv1" )
|
@soc.add_connection( "inst_a", "ifc_a", "inst_b", "ifc_b", "a_new_con" )
|
@soc.add_connection( "inst_a", "ifc_a", "inst_b", "ifc_b", "a_new_con" )
|
@soc.cons[ :a_new_con ].should be == { rule:'or', mapping: [ {inst_a: :ifc_a},{inst_b: :ifc_b} ] }
|
@soc.cons[ :a_new_con ].should be == { rule:'or', mapping: [ {inst_a: :ifc_a},{inst_b: :ifc_b} ] }
|
end
|
end
|
|
|
|
|
|
|
|
|
|
it "should add a connection entry, which connects the toplevel's port" do
|
|
|
|
ifc_spc = SOCMaker::IfcSpc.new( "myifc", "v1", 'ports' => { port_a: 1, port_b: 0 } )
|
|
ifc_def_1 = SOCMaker::IfcDef.new( "myifc", "v1", 0, { a: SOCMaker::IfcPort.new( "port_a", 1 ) } )
|
|
ifc_def_0 = SOCMaker::IfcDef.new( "myifc", "v1", 1, { b: SOCMaker::IfcPort.new( "port_b", 1 ) } )
|
|
file = { "file.vhd".to_sym => SOCMaker::HDLFile.new( "./file.vhd" ) }
|
|
core_a = SOCMaker::CoreDef.new( "core_a", "v1", file, "top" )
|
|
core_a.interfaces[ :ifc_a ] = ifc_def_0
|
|
core_a.interfaces[ :ifc_b ] = ifc_def_1
|
|
|
|
SOCMaker::lib.add_ifc( ifc_spc )
|
|
SOCMaker::lib.add_core( core_a )
|
|
|
|
|
|
SOCMaker::lib.add_core( @soc )
|
|
@soc.interfaces[ :t1 ] = ifc_def_1
|
|
@soc.cores[ :inst_a ] = SOCMaker::CoreInst.new( "core_av1" )
|
|
@soc.add_connection( "inst_a", "ifc_a", @soc.name, "t1", "a_new_con" )
|
|
@soc.cons[ :a_new_con ].should be == { rule:'or', mapping: [ {inst_a: :ifc_a},{ @soc.name.to_sym => :t1} ] }
|
|
end
|
|
|
|
|
|
|
it "should raise an error, if a parameter of unkonwn core is set" do
|
it "should raise an error, if a parameter of unkonwn core is set" do
|
expect{ @soc.set_param( "a_unknown_core", "p1", 1234 ) }.
|
expect{ @soc.set_param( "a_unknown_core", "p1", 1234 ) }.
|
to raise_error( SOCMaker::ERR::ProcessingError )
|
to raise_error( SOCMaker::ERR::ProcessingError )
|
end
|
end
|
|
|