hdl/*/position_calc/generated/*: add parametrized function

Instead of hardcoded filename paths we use a utility function
that does the job for us.