  We present a stellar populations analysis of the first release of the CFHTLS
(Canada-France-Hawai Telescope Legacy Survey) data. A detailed comparison
between the Besan\c{c}on model of the Galaxy and the first data release of the
CFHTLS-Deep survey is performed by implementing the MEGACAM photometric system
in this model using stellar atmosphere model libraries. The reliability of the
theoretical libraries to reproduce the observed colours in the MEGACAM system
is investigated. The locations of various stellar species like subdwarfs, white
dwarfs, late-type and brown dwarfs, binary systems are identified. The
contamination of the stellar sample by quasars and compact galaxies is
quantified using spectroscopic data from the VIMOS-VLT Deep Survey (VVDS) as a
function of $i'$ magnitude and $r'-i'$ colour. A comparison between simulated
counts using the standard IMF at low masses show that the number of very low
mass dwarfs may have been underestimated in previous studies. These
observations favour a power law IMF following $d(n)/dm \propto m^{-\alpha}$
with $\alpha=2.5$ for $m < $ 0.25 \Msun or $\alpha=3.0$ for $m < $ 0.2 \Msun
for single stars. The resulting LF is in agreement with the local LF as
measured from the 5 or 25 pc samples. It is in strong disagreement with the
Zheng et al (2001) LF measured from deep HST data. We show that this
discrepancy can be understood as an indication of a different IMF at low masses
at early epochs of the Galaxy compared to the local thin disc IMF.
