OpenCores
URL https://opencores.org/ocsvn/soc_maker/soc_maker/trunk

Subversion Repositories soc_maker

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /soc_maker/trunk/spec
    from Rev 3 to Rev 5
    Reverse comparison

Rev 3 → Rev 5

/test_soc.yaml
8,7 → 8,22
author: 'feddischson'
authormail: 'feddischson [ at ] opencores.org'
vccmd: ''
interfaces: {}
interfaces:
:top_ifc: SOCM_IFC
name: core_AB_ifc
dir: 0
version: "1"
ports:
:sig_con1a: SOCM_PORT
defn: sig_a
len: 8
:sig_con1b: SOCM_PORT
defn: sig_b
len: 8
:sig_con1c: SOCM_PORT
defn: sig_c
len: 1
functions: {}
inst_parameters: {}
static_parameters: {}
38,5 → 53,10
:mapping:
- :inst_a: :ifc01
- :inst_c: :myifc
# :top_con:
# :rule: or
# :mapping:
# - :test_soc: :top_ifc
# - :inst_d: :myifc
hdlfiles: {}
toplevel: test_soc_top
/core_inst_spec.rb
80,6 → 80,24
 
end
 
describe SOCMaker::CoreDef, "HDL interaction" do
 
it 'should return true and false for implements_port?, when a port is implemented and
not implemented' do
file = { "file.vhd".to_sym => SOCMaker::HDLFile.new( "./file.vhd" ) }
core = SOCMaker::CoreDef.new( "mycore", "rel1", file, "top" )
ifc_spc = SOCMaker::IfcSpc.new( "a_ifc", "v1", "ports" => { p1: 1, p2: 0 } )
ifc = SOCMaker::IfcDef.new( "a_ifc", "v1", 1, { p1: SOCMaker::IfcPort.new( "p1", 1 ) } )
core.interfaces[ :i1 ] = ifc
SOCMaker::lib.add_core( core )
SOCMaker::lib.add_ifc( ifc_spc )
 
o1 = SOCMaker::CoreInst.new( "mycorerel1", {} )
o1.implements_port?( 'i1', 'p1' ).should be == true
o1.implements_port?( 'i1', 'p2' ).should be == false
end
end
 
describe SOCMaker::CoreDef, "object handling, en-decoding:" do
 
it "should be possible to encode and decode a core instance" do
/soc_def_spec.rb
285,6 → 285,32
@soc.cons[ :a_new_con ].should be == { rule:'or', mapping: [ {inst_a: :ifc_a},{inst_b: :ifc_b} ] }
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
expect{ @soc.set_param( "a_unknown_core", "p1", 1234 ) }.
to raise_error( SOCMaker::ERR::ProcessingError )
/component_spec.rb
174,7 → 174,9
a_is_last.should be == [ false, false, false, true ]
end
 
 
 
it 'should iterate over all ports' do
 
SOCMaker::lib.clear

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.