Domain specific languages for programming software switches have become an attractive choice, but the challenge of achieving line-rate for different workloads and platforms still persists. We propose a tool which takes a high level specification of a network program written in P4 language as input, automatically synthesizes an optimal configuration to execute the program, generates the code for the selected configuration resulting in an efficient software switch for the underlying hardware.