Commit 38de7108 authored by Rémi's avatar Rémi
Browse files

Add get_depth

parent 9d0050d9
name = "AdderGraphs"
uuid = "818587fb-0c22-4279-a2b9-8b16b5360b71"
version = "0.2.10"
version = "0.2.11"
......@@ -111,6 +111,7 @@ export get_adder_lsb_in
export get_nb_full_adders
export set_nb_full_adders!
export produce_addernode
export get_depth
......
......@@ -145,3 +145,12 @@ function produce_addernode(input_adders::Vector{AdderNode}, shifts::Vector{Int},
addernode = AdderNode(_compute_value_from_inputs(inputs), inputs)
return addernode
end
function get_depth(addernode::AdderNode)
if get_value(addernode) == 1
return 0
end
return maximum(get_depth.(get_input_addernodes(addernode)).+1)
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment