\documentclass[border=0mm]{standalone}

\usepackage{cmap}
\usepackage[cp1250]{inputenc}	
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{float}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{upgreek}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepgfplotslibrary{fillbetween}
\usepgfplotslibrary{units}
% \makeatletter
%\pgfplotsset{
%  unit code/.code 2 args=
%    \begingroup
%    \protected@edef\x{\endgroup\si{#2}}\x
%} 
%\makeatother

\pgfkeys{%
  /tikz/on layer/.code={
    \pgfonlayer{#1}\begingroup
    \aftergroup\endpgfonlayer
    \aftergroup\endgroup
  }
}

\begin{document}
	\begin{tikzpicture}
		\begin{axis}[
			height=6cm,	width=9cm,	grid=major,
    		x unit=\SI{}{\nano\second}, y unit=\SI{}{\volt},
			xlabel=$t$,	ylabel={$V_\mathrm{Oa}$,$V_\mathrm{BOa}$},
			ymin=-0.2,ymax=1.4,
			xmin=0, xmax=0.5,
			ytick distance = 0.2,
			%xtick distance = 0.05,
			set layers,
			%x tick label style={/pgf/number format/.cd, set thousands separator={}},
			xticklabel shift = 2 pt,
			legend pos=north west,
			x tick label style={
        /pgf/number format/.cd,
            fixed,
            precision=2,
        /tikz/.cd
    }
		]		
		
			\addplot +[name path = FF, solid, smooth, thick,color=blue,mark=none] table [x expr=\thisrow{tx}*1e9-48.95, y expr=\thisrow{ty}, col sep=comma] {../cadence_data/ccdlu_transient.csv};
			\label{Oa};
			\addplot +[name path = SS, solid, smooth, thick,color=red,mark=none] table [x expr=\thisrow{bufx}*1e9-48.95, y expr=\thisrow{bufy}, col sep=comma] {../cadence_data/ccdlu_transient.csv};
			\label{BOa};
			
		\end{axis}

		\begin{axis}[
			%scale only axis,
			height=6cm,	width=9cm,
			xmin=0, xmax=0.5,
			ymin=-5,ymax=35,
			ytick distance = 5,
			axis y line*=right,
			axis x line=none,
			y unit=\SI{}{\micro\ampere},
			ylabel={$I_\mathrm{DD}$},
			legend pos=north west
			%legend style={at={(0.3,0.95)},anchor=north}
			]
			\addlegendimage{/pgfplots/refstyle=Oa}
			\addlegendentry{$V_\mathrm{O}$};
			\addlegendimage{/pgfplots/refstyle=BOa}
			\addlegendentry{$V_\mathrm{BO}$};
			\addplot +[solid, smooth, thick,color=black,mark=none] table [x expr=\thisrow{ix}*1e9-48.95, y expr=\thisrow{iy}*1e6, col sep=comma] {../cadence_data/ccdlu_transient.csv};
			\addlegendentry{$I_\mathrm{Oa}$};
		\end{axis}		
		
	\end{tikzpicture}
\end{document}